mwang87 / MetabolomicsSpectrumResolver

Metabolomics Spectrum Resolver/Displayer
https://metabolomics-usi.ucsd.edu/
MIT License
9 stars 1 forks source link

Wrong Error 500 for not-found spectrum #100

Closed sneumann closed 4 years ago

sneumann commented 4 years ago

Hi, for https://metabolomics-usi.ucsd.edu/json/?usi=mzspec:MASSBANK:EQ325301 you get a nice JSON, but for (inexistent) https://metabolomics-usi.ucsd.edu/json/?usi=mzspec:MASSBANK:EQ32530X you get an 500 Internal Server Error page.

1) That is not valid JSON :-) 2) Maybe the return value should be a 404 Not Found if the target does not exist.

Yours, Steffen

mwang87 commented 4 years ago

Great catch @sneumann! We'll get it fixed in the next release.

bittremieux commented 4 years ago

When using the new style USIs implemented in PR #88 the error message will be more informative. image

Although that's only for the landing page. We should probably give proper error status for the JSON endpoint.