diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-03-07 18:27:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-07 18:27:29 +0100 |
commit | b3b6c4f1695e0e552dc3d4593412b0e2d6316ec9 (patch) | |
tree | 4292cd7c4827f27618fef8964c1e540725e38b02 /document | |
parent | 338c235e5694f989251ef2112fdd6938ba837c54 (diff) | |
parent | 23db7be16bf266f478f773654137cac43c162fdd (diff) |
Merge pull request #21580 from vespa-engine/arnej/verify-namecollision-fails
struct/document name collision fails
Diffstat (limited to 'document')
-rw-r--r-- | document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java b/document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java index be2c182426e..9325e374daa 100644 --- a/document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java +++ b/document/src/main/java/com/yahoo/document/DocumentTypeManagerConfigurer.java @@ -61,8 +61,13 @@ public class DocumentTypeManagerConfigurer implements ConfigSubscriber.SingleSub public ConfigSubscriber configure(String configId) { ConfigSubscriber subscriber = new ConfigSubscriber(); - subscriber.subscribe(this, DocumentmanagerConfig.class, configId); - return subscriber; + try { + subscriber.subscribe(this, DocumentmanagerConfig.class, configId); + return subscriber; + } catch (RuntimeException e) { + subscriber.close(); + throw e; + } } /** One-shot configuration; should be called on a newly constructed manager */ @@ -264,7 +269,7 @@ public class DocumentTypeManagerConfigurer implements ConfigSubscriber.SingleSub var old = configMap.put(id, dataTypeConfig); if (old != null) { throw new IllegalArgumentException - ("Multiple configs for id "+id+" first: "+old+" second: "+dataTypeConfig); + ("Multiple configs for id "+id+" first:\n"+old+"\nsecond:\n"+dataTypeConfig); } } } |