8000 Pass inner exception to exceptions thrown in JsonApiClient by pascalberger · Pull Request #1357 · ServiceStack/ServiceStack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Pass inner exception to exceptions thrown in JsonApiClient #1357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2025

Conversation

pascalberger
Copy link
Contributor

When during JsonApiClient.SendAsync an exception was thrown, it was catched and instead an WebServiceException thrown. The original exception was ignored, same for the HttpResponseMessage which was passed to the internal CreateException method.

We had cases where the request itself was successful with a HTTP 200, but an WebServiceException was thrown. What we saw in (OpenTelemetry) logs:

exception.message:

Exception of type 'ServiceStack.WebServiceException' was thrown.

exception.stacktrace:

500 Code: Exception of type 'ServiceStack.WebServiceException' was thrown., Message: Exception of type 'ServiceStack.WebServiceException' was thrown.

This PR passes the actual exception as inner exception to the created WebServiceException and also sets the message to the message of the inner exception, so that there is an exception in case ResponseStatus.Message is not available.

@pascalberger pascalberger changed the title Pass inner exception Pass inner exception to exceptions thrown in JsonApiClient May 2, 2025
@mythz mythz merged commit a4f9be2 into ServiceStack:main May 2, 2025
@mythz
Copy link
Member
mythz commented May 2, 2025

thx for the PR!

This change is available from v8.7.3+ which is now available in the pre release packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0