taquito icon indicating copy to clipboard operation
taquito copied to clipboard

Error from HttpBackend has no request info

Open psmolinsky opened this issue 4 years ago • 2 comments

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.

psmolinsky avatar Oct 01 '21 09:10 psmolinsky

Picking this up in 12.1 since it's related to #160

dsawali avatar Apr 04 '22 18:04 dsawali

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?

psmolinsky avatar Jul 26 '22 13:07 psmolinsky

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?

image

hui-an-yang avatar Aug 16 '22 00:08 hui-an-yang

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.

psmolinsky avatar Aug 22 '22 12:08 psmolinsky

Hi @psmolinsky

We understand and make changes accordingly, hope this will be helpful to you:)

image

hui-an-yang avatar Aug 22 '22 22:08 hui-an-yang