graphql-python / graphql-python/flask-graphql
Flask's app.errorhandler decorator dosen't work for GraphQLLocatedError
- Ngôn ngữ chính
- Python
- Star
- 1.3k
- Fork
- 139
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
I am making an extension library [flask-graphql-auth](https://github.com/devArtoria/flask-graphql-auth). and error handler by using flask's app.errorhandler is being planed for the 1.0 release. I checked that if my library caused an exception like JWTDecodeError, an GraphQLLocatedError occurred. However, the flask can not handle the error by app.errorhandler. Is this a bug?
```
@app.errorhandler(GraphQLLocatedError)
def handle(e):
return 401
```
I wrote this code. but stacktrace appears :(
```
...
Traceback (most recent call last):
File "C:\Users\Lewis\OneDrive\Documents\Development Repos\flask-graphql-auth\venv\lib\site-packages\graphql\execution\executor.py", line 330, in complete_value_catching_error
exe_context, return_type, field_asts, info, result)
File "C:\Users\Lewis\OneDrive\Documents\Development Repos\flask-graphql-auth\venv\lib\site-packages\graphql\execution\executor.py", line 383, in complete_value
raise GraphQLLocatedError(field_asts, original_error=result)
graphql.error.located_error.GraphQLLocatedError: Signature verification failed
127.0.0.1 - - [21/Jul/2018 12:48:30] "POST /graphql? HTTP/1.1" 200 -
```
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.