Skip to content

Commit

Permalink
Pass the retry error to user side
Browse files Browse the repository at this point in the history
  • Loading branch information
ruhan1 committed Oct 12, 2024
1 parent 6df155b commit 32e1bd9
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ public Response intercept( @NotNull Chain chain ) throws IOException
{
Request req = chain.request();
Response resp = null;
IOException latestException = null;
int tryCounter = 0;
do {
if ( resp != null )
Expand Down Expand Up @@ -417,10 +418,7 @@ public Response intercept( @NotNull Chain chain ) throws IOException
}
catch( IOException e )
{
if ( tryCounter >= count )
{
throw e;
}
latestException = e;

Span.current().setAttribute( "target.try." + tryCounter + ".error_message", e.getMessage() );
Span.current()
Expand All @@ -447,7 +445,9 @@ public Response intercept( @NotNull Chain chain ) throws IOException

Span.current().setAttribute( "target.retries", tryCounter );

throw new IOException( "Proxy retry interceptor reached an unexpected fall-through condition!" );
throw new IOException( String.format(
"Proxy retry interceptor reached an unexpected fall-through condition! %s, Failed upstream request: %s",
latestException, req.url() ) );
}
}

Expand Down

0 comments on commit 32e1bd9

Please sign in to comment.