From 03314b00e5eab5677ba639b5f459118f3558218a Mon Sep 17 00:00:00 2001 From: Daniel Krueger Date: Tue, 10 Dec 2024 08:16:55 +0100 Subject: [PATCH] prevent 500 on tag conversion error --- .../resources/impl/ProtocolAdaptersResourceImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hivemq-edge/src/main/java/com/hivemq/api/resources/impl/ProtocolAdaptersResourceImpl.java b/hivemq-edge/src/main/java/com/hivemq/api/resources/impl/ProtocolAdaptersResourceImpl.java index b49243410..93d57a8f4 100644 --- a/hivemq-edge/src/main/java/com/hivemq/api/resources/impl/ProtocolAdaptersResourceImpl.java +++ b/hivemq-edge/src/main/java/com/hivemq/api/resources/impl/ProtocolAdaptersResourceImpl.java @@ -644,7 +644,15 @@ protected void validateAdapterSchema( .map(DomainTag::toTagMap) .collect(Collectors.toList()); - final List tags = configConverter.mapsToTags(adapterType, domainTags); + final List tags; + try { + tags = configConverter.mapsToTags(adapterType, domainTags); + } catch (final IllegalArgumentException illegalArgumentException) { + log.warn("Unable to parse tags for adapter '{}'", adapterName); + log.debug("Original Exception: ", illegalArgumentException); + return ErrorResponseUtil.invalidInput( + "Exception during parsing of tags for the adapter. See log for further information."); + } final List northboundMappings = adapter.getNorthboundMappingModels() .stream()