We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
例えば、存在しない project_id を指定して get_project すると
get_project
HTTPError: 404 Client Error: Not Found for url: https://annofab.com/api/v1/projects/1
とだけ表示されますが、レスポンスのボディを調べると
{ "errors": [ { "error_code": "MISSING_RESOURCE", "message": "指定されたリソースは存在しません: production.project_v2 に project_id -> 1というキーが見つかりません。", "ext": {} } ], "context": { "awsRequestId": "afedc4e8-2ed9-48eb-8d90-50c36b81cb66", "logGroupName": "/aws/lambda/project-production-getProject", "logStreamName": "2019/07/04/[$LATEST]3a4d6f3385bb4953abf79d52527a698f" } }
というようになぜ失敗したのかのメッセージが格納されています。 エラー発生時にこのメッセージを併せて表示されると原因がわかりやすくて良いと思います。
The text was updated successfully, but these errors were encountered:
確かに、そうですね。
ちなみに補足ですが、以下のようなloggerを設定しておくと、エラーレスポンスだけでなく、ruquestのheader, request bodyなどもログに出力されます。
import logging logging_formatter = '%(levelname)s : %(asctime)s : %(filename)s : %(name)s : %(funcName)s : %(message)s' logging.basicConfig(format=logging_formatter) logging.getLogger("annofabapi").setLevel(level=logging.DEBUG)
annofab-api-python-client/annofabapi/utils.py
Line 15 in d1f4758
Sorry, something went wrong.
8b271d7
v0.7.2で対応しました。
No branches or pull requests
例えば、存在しない project_id を指定して
get_project
するととだけ表示されますが、レスポンスのボディを調べると
というようになぜ失敗したのかのメッセージが格納されています。
エラー発生時にこのメッセージを併せて表示されると原因がわかりやすくて良いと思います。
The text was updated successfully, but these errors were encountered: