Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Returning 404 on bad solo object search #163

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions simple_app/app_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ def solo_result(query: str):

# search database for given object
resultdict: dict = db.inventory(query)
if not len(resultdict):
abort(404, f'"{query}" does match any result in SIMPLE!')
everything = Inventory(resultdict)

# create camd and spectra plots
Expand Down
2 changes: 1 addition & 1 deletion simple_app/templates/bad_request.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<div class="container">
<h1 class="display-2" style="text-align: center">{{ e.code|safe }}</h1>
<h2 class="display-3" style="text-align: center">Something went wrong!</h2>
<h2 class="display-3" style="text-align: center">Something went wrong:<br>{{ e.description|safe }}</h2>
<h3 class="display-6">Please send the above error code and what you were trying to do, to the
<a href="https://github.com/SIMPLE-AstroDB/SIMPLE-web/issues/new/choose" target="_blank">developers</a>.
</h3>
Expand Down
Loading