Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Important Error Exception is swallowed #147

Open
Gr33nbl00d opened this issue Sep 2, 2020 · 1 comment
Open

Important Error Exception is swallowed #147

Gr33nbl00d opened this issue Sep 2, 2020 · 1 comment

Comments

@Gr33nbl00d
Copy link
Contributor

Gr33nbl00d commented Sep 2, 2020

Code in ConnectionManager (see below) does not print important exceptions anymore if debug is not enabled.
Suggested change:
always log ioexceptions with warning and exception only timeout exceptions with current code.
I guess an ioexception is always an error case and should not happen in normal operation.
Or am i wrong?
At least it might would help to see the error message. (Might add at least e.getMessage() to log output)
Exception which was swallowed in my example:

com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=530, reply-text=NOT_ALLOWED - access to vhost '/' refused for user 'xxx', class-id=10, method-id=40)

Took me quite a while to figure this out :)

try {
connectionManagerLock.lock();
connection = createNewConnection();
return true;
} catch (IOException | TimeoutException e) {
LOGGER.warn("Could not establish connection using {}", config,
LOGGER.isDebugEnabled() ? e : null);
} finally {
connectionManagerLock.unlock();
}

@reinhapa
Copy link
Owner

reinhapa commented Sep 7, 2020

@Gr33nbl00d the question would be to take the multi catch apart and log a simple warning if it's a timeout exception without a stacktrace and an error with stacktrace in case of the remaining IOExceptions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants