GabrielBrascher opened a new pull request #4100: URL: https://github.com/apache/cloudstack/pull/4100
## Description <!--- Describe your changes in detail --> The handling of the exception of RabbitMQ `getConnection()` method can be improved. Example of issues that I have noticed: ``` Failed to create a connection to AMQP server due to null ``` Not all exceptions hold a message; therefore, some exceptions might result in a `null` output instead of the Exception message/stack. With the fix, the error message looks like: ``` Failed to create a connection to AMQP server [AMQP host:amqp.host.org, port:123] due to: java.net.UnknownHostException: amqp.host.org: Name or service not known Failed to create a connection to AMQP server [AMQP host:null, port:null] due to: java.net.ConnectException: Connection refused (Connection refused) ``` ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] Bug fix (non-breaking change which fixes an issue) - [x] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document --> ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
