allthingssecurity commented on code in PR #27694:
URL: https://github.com/apache/camel/pull/27694#discussion_r4246365474


##########
components/camel-whatsapp/src/main/java/org/apache/camel/component/whatsapp/service/WhatsAppServiceRestAPIAdapter.java:
##########
@@ -208,14 +222,12 @@ public void sendMessage(Exchange exchange, AsyncCallback 
callback, T message, St
                         exchange.getMessage().setBody(result);
                     } else {
                         LOG.debug("Error response Headers {}", 
response.headers());
-                        RuntimeException exception = new RuntimeCamelException(
-                                uri + " responded: " + statusCode + " and 
body: " + response.body());
-                        exchange.setException(exception);
-                        throw exception;
+                        exchange.setException(new RuntimeCamelException(
+                                uri + " responded: " + statusCode + " and 
body: " + response.body()));

Review Comment:
   Done in 7507e86b6b38: the exception for an error response now uses 
`URISupport.sanitizeUri(uri)` as well. The URI is
   `<baseUri>/<apiVersion>/<phoneNumberId>/messages` (or `/media`); the access 
token goes in the `Authorization` header,
   so only a configured `baseUri` could carry credentials. 
`failsTheExchangeForAnErrorResponse` now also asserts that the
   message names the URI. camel-whatsapp: 11 tests, 0 failures.
   
   _Claude Code on behalf of allthingssecurity_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to