Skip to content

Commit

Permalink
also allow setting null message to null in #fromMessage of DittoRunti…
Browse files Browse the repository at this point in the history
…meException

Signed-off-by: Florian Fendt <Florian.Fendt@bosch.io>
  • Loading branch information
ffendt committed Sep 18, 2020
1 parent e11f77d commit 0950340
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public static <T extends DittoRuntimeException> T fromJson(final JsonObject json
}

/**
* Creates a new {@code DittoRuntimeException} from a JSON object.
* Creates a new {@code DittoRuntimeException} from a message.
*
* @param message detail message. This message can be later retrieved by the {@link #getMessage()} method.
* @param dittoHeaders dittoHeaders the headers of the command which resulted in this exception.
Expand All @@ -336,11 +336,10 @@ public static <T extends DittoRuntimeException> T fromJson(final JsonObject json
public static <T extends DittoRuntimeException> T fromMessage(@Nullable final String message,
final DittoHeaders dittoHeaders, DittoRuntimeExceptionBuilder<T> builder) {
checkNotNull(builder, "builder");
if (null != message) {
builder.message(message);
}

return builder.dittoHeaders(dittoHeaders)
return builder
.dittoHeaders(dittoHeaders)
.message(message)
.build();
}

Expand Down

0 comments on commit 0950340

Please sign in to comment.