diff --git a/connector-runtime/connector-runtime-core/src/main/java/io/camunda/connector/runtime/core/error/InvalidInboundConnectorDefinitionException.java b/connector-runtime/connector-runtime-core/src/main/java/io/camunda/connector/runtime/core/error/InvalidInboundConnectorDefinitionException.java new file mode 100644 index 0000000000..d607b2d56d --- /dev/null +++ b/connector-runtime/connector-runtime-core/src/main/java/io/camunda/connector/runtime/core/error/InvalidInboundConnectorDefinitionException.java @@ -0,0 +1,53 @@ +/* + * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH + * under one or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information regarding copyright + * ownership. Camunda licenses this file to you under the Apache License, + * Version 2.0; you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.camunda.connector.runtime.core.error; + +import java.io.Serial; + +/** + * Represents an unchecked exception indicating an invalid definition for an inbound connector. This + * exception is thrown when the connector's definition does not meet the expected format or + * standards. + */ +public class InvalidInboundConnectorDefinitionException extends RuntimeException { + + @Serial private static final long serialVersionUID = 1L; + + /** + * Constructs a new exception with the specified detail message. This constructor is typically + * used when the error message itself is sufficient to describe the problem encountered. + * + * @param message The detailed message that explains the reason for the exception. The detail + * message is saved for later retrieval by the {@link #getMessage()} method. + */ + public InvalidInboundConnectorDefinitionException(final String message) { + super(message); + } + + /** + * Constructs a new exception with the specified detail message and cause. This constructor is + * used when an underlying cause for the exception is available, providing more context for + * troubleshooting. + * + * @param message The detailed message that explains the reason for the exception. + * @param cause The cause of the exception (which is saved for later retrieval by the {@link + * #getCause()} method). A null value indicates that the cause is nonexistent or unknown. + */ + public InvalidInboundConnectorDefinitionException(final String message, final Throwable cause) { + super(message, cause); + } +} diff --git a/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/importer/ProcessDefinitionInspector.java b/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/importer/ProcessDefinitionInspector.java index f86e850501..0474d5a747 100644 --- a/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/importer/ProcessDefinitionInspector.java +++ b/connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/importer/ProcessDefinitionInspector.java @@ -20,7 +20,7 @@ import static io.camunda.connector.runtime.core.Keywords.INBOUND_TYPE_KEYWORD; import static io.camunda.connector.runtime.core.Keywords.MESSAGE_ID_EXPRESSION; -import io.camunda.connector.api.error.InvalidInboundConnectorDefinitionException; +import io.camunda.connector.runtime.core.error.InvalidInboundConnectorDefinitionException; import io.camunda.connector.runtime.core.inbound.InboundConnectorDefinitionImpl; import io.camunda.connector.runtime.core.inbound.correlation.BoundaryEventCorrelationPoint; import io.camunda.connector.runtime.core.inbound.correlation.MessageCorrelationPoint; @@ -195,9 +195,21 @@ private Optional getCorrelationPointForElement( } else if (element instanceof ReceiveTask rt) { return getCorrelationPointForReceiveTask(rt); } - LOG.warn("Unsupported Inbound element type: " + element.getClass()); + LOG.warn( + "Unsupported Inbound element type: {}, in process definition: {} (Key: {}, Version: {})", + element.getClass().getSimpleName(), + definition.getName(), + definition.getKey(), + definition.getVersion()); } catch (InvalidInboundConnectorDefinitionException e) { - LOG.warn(e.getMessage(), e); + LOG.warn( + "Error getting correlation point for {} in process definition: {} (Key: {}, Version: {}): {}", + element.getClass().getSimpleName(), + definition.getName(), + definition.getKey(), + definition.getVersion(), + e.getMessage(), + e); } return Optional.empty(); } diff --git a/connector-sdk/core/src/main/java/io/camunda/connector/api/error/InvalidInboundConnectorDefinitionException.java b/connector-sdk/core/src/main/java/io/camunda/connector/api/error/InvalidInboundConnectorDefinitionException.java deleted file mode 100644 index 83d14690ff..0000000000 --- a/connector-sdk/core/src/main/java/io/camunda/connector/api/error/InvalidInboundConnectorDefinitionException.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH - * under one or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information regarding copyright - * ownership. Camunda licenses this file to you under the Apache License, - * Version 2.0; you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.camunda.connector.api.error; - -import java.io.Serial; - -/** - * Unchecked exception indicating an invalid definition for an inbound connector. This exception is - * thrown when a connector definition does not meet the required criteria. - */ -public class InvalidInboundConnectorDefinitionException extends RuntimeException { - @Serial private static final long serialVersionUID = 1L; - - /** - * Constructs a new exception with the specified detail message. The message should provide a - * clear and concise explanation as to why the connector definition is invalid, aiding in - * diagnostics and troubleshooting. - * - * @param message - the detail message pertaining to the invalid connector definition - */ - public InvalidInboundConnectorDefinitionException(String message) { - super(message); - } -}