From ce2fd1cf3bb2cfd657e1440497484bd27c4af9ac Mon Sep 17 00:00:00 2001 From: Rafael Winterhalter Date: Mon, 18 Dec 2023 12:29:08 +0100 Subject: [PATCH] Do not fallback to unsupported operation exceptions to avoid oversights in code changes. --- .../src/main/java/net/bytebuddy/build/Plugin.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/build/Plugin.java b/byte-buddy-dep/src/main/java/net/bytebuddy/build/Plugin.java index c437ee526e..7022081cbe 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/build/Plugin.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/build/Plugin.java @@ -1183,14 +1183,14 @@ public void onError(TypeDescription typeDescription, Plugin plugin, Throwable th * {@inheritDoc} */ public void onError(TypeDescription typeDescription, List throwables) { - throw new UnsupportedOperationException("onError"); + throw new IllegalStateException("Failed to transform " + typeDescription + ": " + throwables); } /** * {@inheritDoc} */ public void onError(Map> throwables) { - throw new UnsupportedOperationException("onError"); + throw new IllegalStateException("Failed to transform at least one type: " + throwables); } }, @@ -1216,7 +1216,7 @@ public void onError(TypeDescription typeDescription, List throwables) * {@inheritDoc} */ public void onError(Map> throwables) { - throw new UnsupportedOperationException("onError"); + throw new IllegalStateException("Failed to transform at least one type: " + throwables); } },