Total Complexity | 3 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from flask import current_app, jsonify |
||
2 | from werkzeug.exceptions import HTTPException |
||
3 | |||
4 | |||
5 | def http_exception_handler(e: HTTPException): |
||
6 | return jsonify({"message": e.description}), e.code |
||
7 | |||
8 | |||
9 | def broad_exception_handler(e: Exception): |
||
10 | # TODO 에러를 세분화해서 잡는 것을 추천합니다. |
||
11 | |||
12 | if current_app.debug: |
||
13 | import traceback |
||
14 | |||
15 | traceback.print_exc() |
||
16 | |||
17 | return "", 500 |
||
18 |