From 6ebd70fc1cdebd90a6c5b21c4626575768b67def Mon Sep 17 00:00:00 2001 From: "martin.dietrich" Date: Fri, 19 Jul 2024 14:36:52 +0200 Subject: [PATCH] spotless --- src/main/java/de/muenchen/mobidam/s3/S3RouteBuilder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/muenchen/mobidam/s3/S3RouteBuilder.java b/src/main/java/de/muenchen/mobidam/s3/S3RouteBuilder.java index 30badc3..9dd7ef5 100644 --- a/src/main/java/de/muenchen/mobidam/s3/S3RouteBuilder.java +++ b/src/main/java/de/muenchen/mobidam/s3/S3RouteBuilder.java @@ -34,12 +34,12 @@ public void configure() { .process(exchange -> { Exception exception = (Exception) exchange.getAllProperties().get(Exchange.EXCEPTION_CAUGHT); // even with onException(S3Exception), the transported exception may still be sth. else: - if (((Throwable)exchange.getAllProperties().get(Exchange.EXCEPTION_CAUGHT)).getCause() instanceof S3Exception s3Exception){ + if (((Throwable) exchange.getAllProperties().get(Exchange.EXCEPTION_CAUGHT)).getCause()instanceof S3Exception s3Exception) { exception = s3Exception; } logException(exchange, exception); var statusCode = HttpStatus.BAD_REQUEST.value(); - if (exception instanceof S3Exception s3Exception){ + if (exception instanceof S3Exception s3Exception) { statusCode = s3Exception.statusCode(); } exchange.getMessage().setBody(ErrorResponseBuilder.build(statusCode, exception.getClass().getName())); @@ -55,7 +55,7 @@ public void configure() { ErrorResponse res = ErrorResponseBuilder.build(HttpStatus.INTERNAL_SERVER_ERROR.value(), exception.getClass().getName()); exchange.getMessage().setBody(res); } - exchange.getMessage().setHeader(Exchange.HTTP_RESPONSE_CODE, ((ErrorResponse)exchange.getMessage().getBody()).getStatus()); + exchange.getMessage().setHeader(Exchange.HTTP_RESPONSE_CODE, ((ErrorResponse) exchange.getMessage().getBody()).getStatus()); }); from("{{camel.route.common}}")