Issue #4645 - do not wrap exceptions from onError with RuntimeException

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
Lachlan Roberts 2020-03-13 13:59:43 +11:00
parent 633298b5c7
commit fcbe704b24
1 changed files with 9 additions and 16 deletions

View File

@ -377,25 +377,18 @@ public class ForwardedRequestCustomizer implements Customizer
// Do a single pass through the header fields as it is a more efficient single iteration. // Do a single pass through the header fields as it is a more efficient single iteration.
Forwarded forwarded = new Forwarded(request, config); Forwarded forwarded = new Forwarded(request, config);
try for (HttpField field : httpFields)
{ {
for (HttpField field : httpFields) try
{ {
try MethodHandle handle = _handles.get(field.getName());
{ if (handle != null)
MethodHandle handle = _handles.get(field.getName()); handle.invoke(forwarded, field);
if (handle != null) }
handle.invoke(forwarded, field); catch (Throwable t)
} {
catch (Throwable t) onError(field, t);
{
onError(field, t);
}
} }
}
catch (Throwable e)
{
throw new RuntimeException(e);
} }
if (forwarded._proto != null) if (forwarded._proto != null)