Skip to content

Commit

Permalink
fail on no result in solo_result
Browse files Browse the repository at this point in the history
  • Loading branch information
Will-Cooper committed Jan 9, 2024
1 parent eb22eb9 commit c333d49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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
4 changes: 2 additions & 2 deletions simple_app/templates/bad_request.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

{% block content %}

<div class="container">
<div class="container" xmlns="http://www.w3.org/1999/html">
<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

0 comments on commit c333d49

Please sign in to comment.