Skip to content
Permalink
Browse files
fixed issue when exception message is null
  • Loading branch information
mgeiss committed Jul 7, 2017
1 parent 52c4371 commit a92c0609a6c72f46f16f1a26a479077e926abe68
Showing 1 changed file with 8 additions and 2 deletions.
@@ -243,8 +243,14 @@ private CommandProcessingException handle(final Throwable th, final CommandSourc
} else {
cause = th;
}
this.logger.info(cause.getMessage(), cause);
this.updateCommandSource(commandSource, cause.getMessage());

final String failureMessage = cause.getClass().getSimpleName() + ": "
+ (cause.getMessage() != null ? cause.getMessage() : "no details available");

this.logger.warn("Error while processing command. {}", failureMessage);

this.updateCommandSource(commandSource, failureMessage);

if (declaredExceptions != null) {
if (Arrays.asList(declaredExceptions).contains(cause.getClass())) {
if (cause instanceof RuntimeException) {

0 comments on commit a92c060

Please sign in to comment.