Skip to content

Commit b28e242

Browse files
authored
other(inbound): Return a specific error code when Inbound activation fails due to CONNECTOR_NOT_REGISTERED (#5684)
1 parent 59532d1 commit b28e242

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

connector-runtime/connector-runtime-spring/src/main/java/io/camunda/connector/runtime/inbound/executable/InboundExecutableRegistryImpl.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747

4848
public class InboundExecutableRegistryImpl implements InboundExecutableRegistry {
4949

50+
private static final String ACTIVATION_FAILURE = "ACTIVATION_FAILURE";
51+
private static final String CONNECTOR_NOT_REGISTERED = "CONNECTOR_NOT_REGISTERED";
5052
private final BlockingQueue<InboundExecutableEvent> eventQueue;
5153
private final ExecutorService executorService;
5254

@@ -290,7 +292,7 @@ private ActiveExecutableResponse mapToResponse(UUID id, RegisteredExecutable con
290292
id,
291293
null,
292294
failed.data().connectorElements(),
293-
Health.down(new Error("Activation failure", failed.reason())),
295+
Health.down(new Error(ACTIVATION_FAILURE, failed.reason())),
294296
List.of());
295297
case ConnectorNotRegistered notRegistered ->
296298
new ActiveExecutableResponse(
@@ -299,7 +301,7 @@ private ActiveExecutableResponse mapToResponse(UUID id, RegisteredExecutable con
299301
notRegistered.data().connectorElements(),
300302
Health.down(
301303
new Error(
302-
"Activation failure",
304+
CONNECTOR_NOT_REGISTERED,
303305
"Connector " + notRegistered.data().type() + " not registered")),
304306
List.of());
305307
case InvalidDefinition invalid ->
@@ -309,7 +311,7 @@ private ActiveExecutableResponse mapToResponse(UUID id, RegisteredExecutable con
309311
invalid.data().connectorElements(),
310312
Health.down(
311313
new Error(
312-
"Activation failure", "Invalid connector definition: " + invalid.reason())),
314+
ACTIVATION_FAILURE, "Invalid connector definition: " + invalid.reason())),
313315
List.of());
314316
};
315317
}

0 commit comments

Comments
 (0)