Skip to content

Commit

Permalink
Merge pull request #1796 from eclipse-ditto/bugfix/ditto-json-excepti…
Browse files Browse the repository at this point in the history
…on-handling

fix regression introduced in #1792
  • Loading branch information
alstanchev authored Nov 6, 2023
2 parents bb6444e + fe58303 commit 23f057a
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ private static URI extractHref(final RuntimeException toWrap) {
public static <I, T> T wrapJsonRuntimeException(final Function<I, T> function, final I input) {
try {
return function.apply(input);
} catch (final JsonRuntimeException | IllegalArgumentException | NullPointerException e) {
} catch (final JsonRuntimeException
| IllegalArgumentException
| NullPointerException
| UnsupportedOperationException e) {
throw new DittoJsonException(e);
}
// "ditto-json" library also throws IllegalArgumentException when for example strings which may not be empty
Expand All @@ -128,9 +131,9 @@ public static <T> T wrapJsonRuntimeException(final Supplier<T> supplier) {
try {
return supplier.get();
} catch (final JsonRuntimeException
| IllegalArgumentException
| NullPointerException
| UnsupportedOperationException e) {
| IllegalArgumentException
| NullPointerException
| UnsupportedOperationException e) {
throw new DittoJsonException(e);
}
// "ditto-json" library also throws IllegalArgumentException when for example strings which may not be empty
Expand All @@ -156,7 +159,10 @@ public static <T, R> R wrapJsonRuntimeException(final T argument, final DittoHea
final BiFunction<T, DittoHeaders, R> function) {
try {
return function.apply(argument, dittoHeaders);
} catch (final JsonRuntimeException | IllegalArgumentException | NullPointerException e) {
} catch (final JsonRuntimeException
| IllegalArgumentException
| NullPointerException
| UnsupportedOperationException e) {
throw new DittoJsonException(e, dittoHeaders);
}
// "ditto-json" library also throws IllegalArgumentException when for example strings which may not be empty
Expand Down

0 comments on commit 23f057a

Please sign in to comment.