Skip to content

Conversation

@KoalaBryson
Copy link
Collaborator

No description provided.

Change-Id: I0c2c3b6fafbfc43eae67abee2811cfa0069476c3
Change-Id: I7067565fbffe0c234222080d88845c0dd22a0867
else:
# 失败:result 是 (status_code, error_type, error_message)
status_code, error_type, error_message = result
return jsonify({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

错误处理应该放到哪里?现在到处都是 return json 。
task_manager 作为一个内部方法应该不能直接返回错误给客户端。层次要分明,返回结果需要在 handler 里构造

推荐方案:
方案A:使用自定义异常类(推荐)
image
image
image

Change-Id: Ia767a1d14c78bd1aa162e7a59363fb585a4b3f0c
Change-Id: Ibf64b9a989b53ea696769cbf3db785856dc3301e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants