Flask's app.errorhandler decorator dosen't work for GraphQLLocatedError
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
调研方向
从 graphql/execution/executor.py 开始,重点查看 complete_value_catching_error 和 complete_value,然后跟踪 /graphql 请求直到 Flask 的 app.errorhandler 注册过程。确定 GraphQLLocatedError 为什么会绕过所报告的 handler;完成的标准是 handler 行为得到可复现的覆盖,并且该 exception 不再绕过 Flask 错误处理。
由索引模型根据 Issue 内容生成。
描述
I am making an extension library 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 -
- 主要语言
- Python
- 星标
- 1.3k
- 派生
- 139
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
graphql-python/flask-graphql 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 25/100
graphql-python/flask-graphql#92 · 2 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 2/5 1-3 小时 新手友好度 35/100
graphql-python/flask-graphql#85 · 2 条评论 · 1 个 reaction ·
-
CSRF Exemption? 未关闭
难度 3/5 1-2 天 新手友好度 25/100
graphql-python/flask-graphql#84 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
graphql-python/flask-graphql#80 · 9 条评论 · 2 个 reaction ·
查看 graphql-python/flask-graphql 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/skills#1811 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
speaches-ai/speaches#678 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
datalayer/mcp-compose#42 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
conda-forge/spacy-feedstock#177 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
UKGovernmentBEIS/inspect_evals#2523 ·