diff options
author | Harald Musum <musum@verizonmedia.com> | 2022-01-21 12:35:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-21 12:35:52 +0100 |
commit | ce1904e3daf1fc9989f26a5f956cb4c104ffc9c9 (patch) | |
tree | 8169d5dfc903d09ef6fb58f111fe5e0ad5f80781 /config-model/src/main/java/com/yahoo/config | |
parent | f67cbb47f2d570f9b3253e0276e3b917c59f7d6e (diff) | |
parent | 785591af27e3bfe348e3c4a6b2e7124ab7bdad75 (diff) |
Merge pull request #20897 from vespa-engine/bratseth/error-reclassification
Classify exceptions better to avoid unnecessary stack traces
Diffstat (limited to 'config-model/src/main/java/com/yahoo/config')
4 files changed, 4 insertions, 4 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/ConfigModelRepo.java b/config-model/src/main/java/com/yahoo/config/model/ConfigModelRepo.java index 8d192414871..77b71a66118 100644 --- a/config-model/src/main/java/com/yahoo/config/model/ConfigModelRepo.java +++ b/config-model/src/main/java/com/yahoo/config/model/ConfigModelRepo.java @@ -153,7 +153,7 @@ public class ConfigModelRepo implements ConfigModelRepoAdder, Serializable, Iter Collection<ConfigModelBuilder> builders = configModelRegistry.resolve(xmlId); if (builders.isEmpty()) - throw new RuntimeException("Could not resolve tag <" + tagName + " version=\"" + tagVersion + "\"> to a config model component"); + throw new IllegalArgumentException("Could not resolve tag <" + tagName + " version=\"" + tagVersion + "\"> to a config model component"); for (ConfigModelBuilder builder : builders) { if ( ! model2Element.containsKey(builder)) { diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java b/config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java index dac62ce7e1b..bb8c4141873 100644 --- a/config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java +++ b/config-model/src/main/java/com/yahoo/config/model/deploy/DeployState.java @@ -161,7 +161,7 @@ public class DeployState implements ConfigDefinitionStore { return hostsReader == null ? new SingleNodeProvisioner() : new HostsXmlProvisioner(hostsReader); } catch (IOException e) { - throw new IllegalStateException("Could not read hosts.xml", e); + throw new RuntimeException("Could not read hosts.xml", e); } } diff --git a/config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java b/config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java index 47a5fb24a43..0ebc661f1d7 100644 --- a/config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java +++ b/config-model/src/main/java/com/yahoo/config/model/producer/AbstractConfigProducer.java @@ -160,7 +160,7 @@ public abstract class AbstractConfigProducer<CHILD extends AbstractConfigProduce * because config IDs must be registered through setConfigId(). */ public final String getConfigId() { - if (configId == null) throw new RuntimeException("The system topology must be frozen first."); + if (configId == null) throw new IllegalStateException("The system topology must be frozen first."); return configId; } diff --git a/config-model/src/main/java/com/yahoo/config/model/provision/Hosts.java b/config-model/src/main/java/com/yahoo/config/model/provision/Hosts.java index c678618311e..c9a03dad65e 100644 --- a/config-model/src/main/java/com/yahoo/config/model/provision/Hosts.java +++ b/config-model/src/main/java/com/yahoo/config/model/provision/Hosts.java @@ -72,7 +72,7 @@ public class Hosts { for (Element hostE : XML.getChildren(doc.getDocumentElement(), "host")) { String name = hostE.getAttribute("name"); if (name.equals("")) { - throw new RuntimeException("Missing 'name' attribute for host."); + throw new IllegalArgumentException("Missing 'name' attribute for host."); } if ("localhost".equals(name)) { name = HostName.getLocalhost(); |