When the request ends with timeout or network error, I get just a generic SdkExecutionError with the root cause buried in the message, for example: Request ended with network error: timeout.
This makes representing the error to the end user harder, for example in OneService we want to format the error into a GraphQL-compliant structure and expose the root cause to the client, so they can react accordingly.
I think what would help here is to either keep the original failure packed in the returned error, or at least pass its kind.
When the request ends with timeout or network error, I get just a generic
SdkExecutionError
with the root cause buried in the message, for example:Request ended with network error: timeout
.This makes representing the error to the end user harder, for example in OneService we want to format the error into a GraphQL-compliant structure and expose the root cause to the client, so they can react accordingly.
I think what would help here is to either keep the original
failure
packed in the returned error, or at least pass itskind
.Relevant code:
https://github.com/superfaceai/one-sdk-js/blob/fbf5e4c2b5707c135f2b086bf2edb9e5df58ae30/src/core/events/failure/policy.ts#L119-L148