taquito
taquito copied to clipboard
Error from HttpBackend has no request info
HttpBackend throws generic Error in case of timeout or when unable to parse the response. This error contains no info about the request. Example: Request timed out after: 30000ms. This error is not handled by upper layer and bubbles up to client code. Therefore it is hard to diagnose.
Describe the solution you'd like Error message contains request URL, maybe also method.
Picking this up in 12.1 since it's related to #160
Hi guys, I think this issue still persists. The latest taquito just wraps an error from axios and it ends up like this:
HttpRequestFailed: Error: timeout of 10ms exceeded
at HttpBackend.<anonymous> ...
So still no info about the actual request. Can you fix it please?
Hi @psmolinsky
We are taking care of this issue. This is a screenshot of what the error will look like added url and method property. Can you let me know if this will fix what you are asking?
Hi @hui-an-yang, thanks for the improvement. From my point of view, it would be the best to include the details in message itself so that simple error.toString() contains them. Properties (like url, method) are usable in the code if someone wants to check them. What do you think?
So suggested Error.message:
Http request POST http://mainnet.api.tez.it/chains/main/blocks/head/helpers/baking_rights?level=0 failed: Error: timeout of 1ms exceeded.
Hi @psmolinsky
We understand and make changes accordingly, hope this will be helpful to you:)