You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/12/16 20:16:55 UTC

[GitHub] [camel] jeremyross opened a new pull request #6549: CAMEL-13180: camel-salesforce: Custom errors

jeremyross opened a new pull request #6549:
URL: https://github.com/apache/camel/pull/6549


   In case of non-2xx responses to Apex REST requests, preserve the
   response content since it won't necessarily be in the standard
   salesforce exception format.
   
   Is it a terrible idea to return an InputStream in the Exception? Very possible that it would only get closed when the exception gets GC'd. I believe it's always a ByteArrayInputStream, so at least no file/socket handles are involved. I'd like to avoid returning the response content as the message body. Since this is for exceptional situations, I think it makes sense to use an exception and preserve the `in` message body for logging/debugging capabilities.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] jeremyross commented on pull request #6549: CAMEL-13180: camel-salesforce: Custom errors

Posted by GitBox <gi...@apache.org>.
jeremyross commented on pull request #6549:
URL: https://github.com/apache/camel/pull/6549#issuecomment-996224328


   Some more context for this. Usually for non-2xx responses from salesforce , the response body is very standardized, and we deserialize to `RestError`. With these custom Apex REST endpoints that salesforce devs can create, they're free to return *anything* in the response content. So the idea is, if the deserialization to `RestError` fails or is not meaningful, we can make the response content stream available to the route so it's not lost.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] jeremyross merged pull request #6549: CAMEL-13180: camel-salesforce: Custom errors

Posted by GitBox <gi...@apache.org>.
jeremyross merged pull request #6549:
URL: https://github.com/apache/camel/pull/6549


   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org