diff options
author | Arne Juul <arnej@yahooinc.com> | 2023-03-23 09:41:45 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahooinc.com> | 2023-03-23 09:41:45 +0000 |
commit | 64dac2f27014d8731814d6179085694d5aa9a11f (patch) | |
tree | 8d81be9481f3e8e9d6d91a53a48cb41e789a25bd /config-model/src/main/java/com/yahoo/schema/derived/RankProfileList.java | |
parent | a9a6d2275c49f5690791cbb50648589ea800a146 (diff) |
improve error for cycle in ranking expression functions
Diffstat (limited to 'config-model/src/main/java/com/yahoo/schema/derived/RankProfileList.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/schema/derived/RankProfileList.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/derived/RankProfileList.java b/config-model/src/main/java/com/yahoo/schema/derived/RankProfileList.java index a50ddd4aeea..ac7495d09c7 100644 --- a/config-model/src/main/java/com/yahoo/schema/derived/RankProfileList.java +++ b/config-model/src/main/java/com/yahoo/schema/derived/RankProfileList.java @@ -127,8 +127,9 @@ public class RankProfileList extends Derived implements RankProfilesConfig.Produ throw new IllegalStateException(e); } catch (ExecutionException e) { - throw e.getCause() instanceof IllegalArgumentException ? (IllegalArgumentException)e.getCause() - : new IllegalStateException(e); + if (e.getCause() instanceof IllegalArgumentException iArg) throw iArg; + if (e.getCause() instanceof IllegalStateException iState) throw iState; + throw new IllegalStateException(e); } } |