Skip to content

Commit 4cca60e

Browse files
committed
refactor exception
1 parent f9484f9 commit 4cca60e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugins/plugin_package/plugin_package.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@ def parse_args(self, argv):
3131

3232
def run(self, argv, dependencies):
3333
cmd = self._get_sdkbox_path() + ' --runincocos ' + ' '.join(argv)
34-
retval = self._run_cmd(cmd)
35-
if 0 != retval:
36-
raise Exception('Run cocos package fail')
34+
ret = self._run_cmd(cmd)
35+
if 0 != ret:
36+
message = MultiLanguage.get_string('COCOS_ERROR_RUNNING_CMD_RET_FMT', str(ret))
37+
raise cocos.CCPluginError(message, cocos.CCPluginError.ERROR_RUNNING_CMD)
3738

3839
def _run_cmd(self, command, cwd=None):
3940
# cocos.CMDRunner.run_cmd(command, False, cwd=cwd)

0 commit comments

Comments
 (0)