Camunda 8.5 REST Connector Error Codes

Hi All,
I am trying to implement a REST call using Camunda 8.5 REST Version 6 Connector. However I am facing issue with Error Handling after the call is completed

reference for Connector error code : Using Connectors | Camunda 8 Docs

REST Info
Method : POST
Headers:
Content-type: “application/x-www-form-urlencoded”

Payload :
{
filename: id,
fileCreatedTimestamp: now()
}

Error Handling :
if error.code != “201” then
bpmnError(“Error_LockADM”, “Not a 201”)
else if response.body.status = “failed” then
bpmnError(“FAILED”, “Action failed”, response.body)
else
null

Even If I get statusCode 201, ErrorHanding fails and still redirects to UserTask

image

Connector Logs:
{“timestampSeconds”:1718909636,“timestampNanos”:676198653,“severity”:“INFO”,“thread”:“pool-2-thread-4”,“logger”:“com.google.api.client.http.HttpTransport”,“message”:“-------------- RESPONSE --------------\nHTTP/1.1 201 \nX-Content-Type-Options: nosniff\nX-XSS-Protection: 1; mode\u003dblock\nCache-Control: no-cache, no-store, max-age\u003d0, must-revalidate\nPragma: no-cache\nExpires: 0\nStrict-Transport-Security: max-age\u003d31536000 ; includeSubDomains\nX-Frame-Options: DENY\nSet-Cookie: SESSION\u003dNmRmZGU1YmItNTIzZC00NzFiLTllN2UtYmNjOTk0MjllZGUw; Path\u003d/adm; Secure; HttpOnly; SameSite\u003dLax\nX-Auth-Token: 6dfde5bb-523d-471b-9e7e-bcc99429ede0\nContent-Length: 0\nDate: Thu, 20 Jun 2024 18:53:56 GMT\nKeep-Alive: timeout\u003d60\nConnection: keep-alive\nSet-Cookie: BIGipServerP_55.32.24.15_admb2b-int2.int.be.xpi_11843\u003d1477779511.17198.0000; path\u003d/; Httponly; Secure\n”,“context”:“default”,“serviceContext”:{“service”:“connectors”,“version”:“unknown”}}
{“timestampSeconds”:1718909636,“timestampNanos”:900164623,“severity”:“DEBUG”,“thread”:“pool-2-thread-4”,“logger”:“io.camunda.connector.runtime.core.outbound.ConnectorJobHandler”,“message”:“Throwing BPMN error for job 2251799814328096 with code Error_LockADM”,“context”:“default”,“serviceContext”:{“service”:“connectors”,“version”:“unknown”}}

Also tried the following errorHandling, Still the same issue.

if response.status != “201” then
bpmnError(“Error_LockADM”, “Not a 201”)
else if response.status = “404” then
bpmnError(“Error_LockADM”, “Action failed”, response.body)
else
null

Somewhere I found the following issue, where REST Connector does not support Content-Type - application/x-www-form-urlencoded. I believe the issue is fixed in 8.5, Since the call is successfull

Am I doing some thing wrong with error handling, I am not getting the right picture here. Please suggesst. If I am missing anything

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.