Skip to content

Commit

Permalink
improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Aug 31, 2024
1 parent 31b9f49 commit 9a97ac7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def plain_text_exception_handler(req: Request, exc: HTTPException) -> Template:
"error": repr(exc),
"method": req.method,
"url": str(req.url),
"extra": exc.extra,
"detail": exc.detail,
},
)
Expand Down
9 changes: 9 additions & 0 deletions server/templates/error.html.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@
<div class="row">
method: {{ method }}
</div>

<div class="row">
url: {{ url }}
</div>

<div class="row">
{{ error }}
</div>

{% if extra %}
<div class="row">
{{ detail }}
</div>
{% endif %}

{% if detail %}
<div class="row">
{{ detail }}
Expand Down

0 comments on commit 9a97ac7

Please sign in to comment.