Skip to content

Commit

Permalink
fix: improve logging for corner cases (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
artsiomkorzun authored Jan 15, 2024
1 parent 7cfae4c commit 6429c26
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,11 @@ private void handleProxyConnectionError(Throwable error) {
* Called when proxy received failed response the origin.
*/
private void handleProxyResponseError(Throwable error) {
log.warn("Proxy received response error from origin. Trace: {}. Span: {}. Key: {}. Deployment: {}. Address: {}. Error: {}",
log.warn("Proxy received response error from origin. Trace: {}. Span: {}. Key: {}. Deployment: {}. Address: {}. Error:",
context.getTraceId(), context.getSpanId(),
context.getProject(), context.getDeployment().getName(),
context.getProxyRequest().connection().remoteAddress(),
error.getMessage());
error);

respond(HttpStatus.BAD_GATEWAY, "Received error response from origin");
}
Expand All @@ -361,8 +361,8 @@ private void handleProxyResponseError(Throwable error) {
* Called when proxy failed to send response to the client.
*/
private void handleResponseError(Throwable error) {
log.warn("Can't send response to client. Trace: {}. Span: {}. Error: {}",
context.getTraceId(), context.getSpanId(), error.getMessage());
log.warn("Can't send response to client. Trace: {}. Span: {}. Error:",
context.getTraceId(), context.getSpanId(), error);

context.getProxyRequest().reset(); // drop connection to stop origin response
context.getResponse().reset(); // drop connection, so that partial client response won't seem complete
Expand Down

0 comments on commit 6429c26

Please sign in to comment.