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

hpo term id search 500 error response not in json format #186

Open
stolpeo opened this issue Jul 19, 2024 · 2 comments
Open

hpo term id search 500 error response not in json format #186

stolpeo opened this issue Jul 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@stolpeo
Copy link

stolpeo commented Jul 19, 2024

Describe the bug
In case a query for an HPO term fails because it can't be found, an 500 error message is issued with a string describing the error. However downstream tools like reev-frontend-lib have issues processing the error response because the response data is expected to be in json format.

CustomError::new(anyhow::anyhow!("Term ID {} not found in HPO", term_id))

To Reproduce

$ curl -i http://localhost:8000/proxy/varfish/viguno/hpo/terms?term_id=HP%3A2134567
HTTP/1.1 500 Internal Server Error
Server: WSGIServer/0.2 CPython/3.10.12
content-type: text/plain; charset=utf-8
date: Fri, 19 Jul 2024 08:44:24 GMT
Server-Timing: TimerPanel_utime;dur=15.056000000015501;desc="User CPU time", TimerPanel_stime;dur=0.0;desc="System CPU time", TimerPanel_total;dur=15.056000000015501;desc="Total CPU time", TimerPanel_total_time;dur=15.667679952457547;desc="Elapsed time", SQLPanel_sql_time;dur=0;desc="SQL 0 queries", CachePanel_total_time;dur=0;desc="Cache 0 Calls"
X-Frame-Options: DENY
Content-Length: 35
Vary: Cookie
X-Content-Type-Options: nosniff
Referrer-Policy: same-origin
 
Term ID HP:2134567 not found in HPO  # SHOULD BE JSON FORMAT
@stolpeo stolpeo added the bug Something isn't working label Jul 19, 2024
@stolpeo
Copy link
Author

stolpeo commented Jul 19, 2024

There might be other error responses as well not responding in JSON format.

@stolpeo
Copy link
Author

stolpeo commented Jul 19, 2024

Additionally, reev-frontend-lib seems to expect a 404 in this case, according to the tests. So probably also the return code is not correct.

https://github.com/bihealth/reev-frontend-lib/blob/736c8f9fab0a51a8e20340e12b556c298c5615bf/src/api/viguno/client.spec.ts#L180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant