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
8000
merged 1 commit into from
May 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ServiceStack/src/ServiceStack.Client/JsonApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ private async Task<TResponse> ThrowIfErrorAsync<TResponse>(Func<Task<TResponse>>
}
catch (Exception e)
{
throw CreateException(httpRes, e);
throw CreateException(e);
}

if (!httpRes.IsSuccessStatusCode)
Expand All @@ -821,7 +821,7 @@ private TResponse ThrowIfError<TResponse>(Func<TResponse> fn, HttpResponseMessag
}
catch (Exception e)
{
throw CreateException(httpRes, e);
throw CreateException(e);
}

if (!httpRes.IsSuccessStatusCode)
Expand All @@ -846,7 +846,7 @@ protected T ResultFilter<T>(T response, HttpResponseMessage httpRes, string http
return response;
}

private static WebServiceException CreateException(HttpResponseMessage httpRes, Exception ex) => new();
private static WebServiceException CreateException(Exception ex) => new(ex.Message, ex);

readonly ConcurrentDictionary<Type, Action<HttpResponseMessage, object?, string, object?>> responseHandlers = new();

Expand Down
0