Improve how Compute handle 401 responses

Not sure if this is the best place to post this, but since the repo doesn’t have Issues enabled I figured I would post it here.
Let me know if there is a better place for posts like this.

When using the RhinoCompute JS library, if you have a missing or incorrect authToken (a missing letter), the computeFetch raises a JSON parsing error because the response cannot be jsonified.

I think a better behaviour would be to check if request was OK before trying calling json()
if request was not 200 raise an error stating why request failed (eg. 401 Unautorized) instead of letting json() fail with a json parsing error

1 Like

Hey @gtalarico1, sorry for the delay. Good idea! I’ve logged this as COMPUTE-90. Pull requests welcome, of course!

We’ll open up issues on the compute repo shortly, just want to make sure that the link I added between GitHub and YouTrack is working well for us on the rhino3dm repo first! It’s tricky keeping track of and prioritising stuff if it’s all in different places :slight_smile:

1 Like