berlinguyinca / spectra-hash

The splash, this is the reference documentation
http://splash.fiehnlab.ucdavis.edu
BSD 3-Clause "New" or "Revised" License
23 stars 11 forks source link

Handling of non numeric requests in API #43

Open tsufz opened 4 years ago

tsufz commented 4 years ago

Hi Gert, Unfortunately, I had a curious situation in the last days. Due to an incorrect declaration, I did sent tables of TRUE values and not the mz and intensity data. However, I got back SPLASHes, but they have been wrong and only the last block was different due to changing number of peaks.

I suggest to add an error handler to the SPLASH API in order to check for empty values, NA, NaN, TRUE / FALSE which triggers the return of an error value or hint and not of a SPLASH.

Thanks and best wishes, Tobias

ssmehta commented 4 years ago

Hi Tobias, can you give an example call that's failing? I had a look at the REST API and tried changing values in the JSON request to True/False but always hit server side errors (as expected).

If the issue is in the R API, I'm happy to have a look at it and a code snippet would be helpful to debug. But I'm also a very infrequent user of R, so perhaps Steffen would be the best person to ask as he wrote the R implementation.

Best, Sajjan

tsufz commented 4 years ago

Hi Sajjan, Thanks for your response. I had a look on the code of @sneumann. I think I could add a fix of the problem by myself and I send a pull request as soon as finished. It is just a simple check if the submitted data is numeric or not. In the latter case, a SPLASH is derived and this should be avoided.

Best, Tobias

ssmehta commented 4 years ago

That sounds great, thanks!

I check one further edge case against the REST API and found out that sending an empty ion list yields a SPLASH, which doesn't make sense. I'll look into updating this to return a useful error.

Best, Sajjan

On Thu, Feb 27, 2020 at 1:03 PM Tobias Schulze notifications@github.com wrote:

Hi Sajjan, Thanks for your response. I had a look on the code of @sneumann https://github.com/sneumann. I think I could add a fix of the problem by myself and I send a pull request as soon as finished. It is just a simple check if the submitted data is numeric or not. In the latter case, a SPLASH is derived and this should be avoided.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/berlinguyinca/spectra-hash/issues/43?email_source=notifications&email_token=AACNSBDXM5BYMBHBBM44OPTRE76AXA5CNFSM4KZYBVS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENFK5CI#issuecomment-592096905, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACNSBDG2DVDJ7JXEO5ET3LRE76AXANCNFSM4KZYBVSQ .