Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Commit

Permalink
Add err_msg parameter to error view
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron-lane committed Dec 29, 2023
1 parent 2646b11 commit 043a2e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/templates/app/PollState.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
}

function setErrorPath() {
window.location.href = "/error";
window.location.href = "/error?err_msg=Failed%20to%20process%20the%20file.";
}

function poll() {
Expand Down
6 changes: 4 additions & 2 deletions app/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,11 @@ def download_file(request: HttpRequest):
return _error(request=request, err_msg=f"Failed to download file: {e}")


def error(request):
def error(request: HttpRequest):
"""Error page"""
return _error(request)
err_msg = request.GET.get("err_msg", "Something went wrong.")

return _error(request=request, err_msg=err_msg)


"""
Expand Down

0 comments on commit 043a2e3

Please sign in to comment.