fix(cli): 类型/语法错误只输出单行消息
Projectrans 顶层捕获 TypeError/SyntaxError,直接输出 [TPC] 报文并退出,不再打印 Python 调用栈。
This commit is contained in:
1 parent
0bded58999
commit
2d0ab9c11f
1 file changed
+4
@@ -39,6 +39,10 @@ if __name__ == '__main__':
|
||||
try:
|
||||
main()
|
||||
_timing_status: str = '成功'
|
||||
except (TypeError, SyntaxError) as _e:
|
||||
_timing_status = '失败'
|
||||
_sys.stderr.write(f'{_e}\n')
|
||||
raise SystemExit(1)
|
||||
except BaseException:
|
||||
_timing_status = '失败'
|
||||
raise
|
||||
|
||||
Reference in new issue
Block a user