Echo JS 0.11.0

<~>
tracker1 18 days ago. link 1 point
Personally, I don't like using the thenable syntax or response.json() directly with fetch api.  I prefer to use async/await syntax against response.text() then JSON parse directly, keeping a handle to the original request... Then I can return the json body or text body with the error and the result code as part of the error raised.  I'll usually put this directly in a function that will give me more information as part of the error chain.

Using thenables this way makes it a lot harder to do that.

Replies