Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

FIX: Pass API errors to frontend during job execution failures #69

Merged
merged 1 commit into from
Jul 22, 2016

Conversation

jakereps
Copy link
Member

@jakereps jakereps commented Jul 19, 2016

Expands the try block on the job execution endpoint to include the async call, allowing for the passing of the matplotlib backend errors.

Fixes #68

@ebolyen, @Kleptobismol can you review?

@thermokarst
Copy link
Contributor

Confirmed that the mpl backend error case is caught by this, although I wonder if using a different status code makes more sense (like a 500, because the error is originating from the server). At the same time, it probably doesn't matter.

@ebolyen
Copy link
Member

ebolyen commented Jul 22, 2016

I agree that 500 makes sense for this, but we'd have to differentiate between error types (possible, but sounds like a pain at the moment). Probably the best way to handle this would be to have a specific set of Exception subclasses which we can recognize, and then anything else becomes a 500. We could probably write a decorator of some kind so that every request can handle exceptions uniformly (then it's just a matter of consistently doing something useful with it on the front-end).

@ebolyen
Copy link
Member

ebolyen commented Jul 22, 2016

This looks good to me, thanks @jakereps!

@ebolyen ebolyen merged commit 4e2868d into qiime2:master Jul 22, 2016
@jakereps
Copy link
Member Author

Thanks for testing, @thermokarst! I think a few of the status codes on the backend don't exactly fit what they are doing, but our front end doesn't really differentiate using the codes (yet?). Our fetch call used for all endpoint communications just uses if (!response.ok) { ...throw Error... }, which I think only looks if it's in the 200s.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants