Get HTTP headers from web response

Hi
See the following output from devtools:

	"debug": {

		"message": "Web Request failed with status 503 Service Unavailable",

		"url": "https://api.sandbox.roadlink.app/sync_house_consignment?transport_mode=road",

		"statusCode": 503,

		"statusText": "Service Unavailable",

		"responseHeaders": {

			"date": "Wed, 23 Sep 2026 13:01:52 GMT",

			"content-type": "application/json",

			"content-length": "40",

			"connection": "keep-alive",

			"x-roadlink-error-source": "digitoll",

			"x-digitoll-error-stage": "submission",

			"apigw-requestid": "EJ0ShiFhAi0EN7Q="

		},

		"responseData": {

			"message": "Endpoint request timed out"

		}

	},

Is it possible to fetch the 2 http respoonse headers:
“x-roadlink-error-source”: “digitoll”,

			"x-digitoll-error-stage": "submission",

By using the result parser? Current code: const debug = {

httpStatusCode,

code,

name,

message,

body

}

return {

allData: JSON.stringify(debug),

name,

message,

body,

code,

httpStatusCode,

}

Something like this:
const errorSource = responseHeaders?.[“x-roadlink-error-source”] ?? null; const errorStage = responseHeaders?.[“x-digitoll-error-stage”] ?? null;

I want to map these headers (if they exist) to my database for error handling.

Is it possible?

thanks

Hi Johan,

Unfortunately, it isn’t possible today. Response headers are only available in the Web Request’s own Result Parser, and that parser only runs when the request succeeds (a 2xx status). When the request fails, as with your 503, the error goes to Catch Exception. Its Result Parser only gets these values:

  • httpStatusCode
  • code
  • name
  • message
  • body (the response body from the external service)

The headers are part of the debug information, which is why you can see them in DevTools, but Catch Exception can’t reach them yet.

We agree this should be possible, so we’ve registered it as an improvement: making responseHeaders available in the Catch Exception Result Parser. I can’t give a timeline yet, but we’ll update this thread when it’s released.

If you’re in contact with the Roadlink API team, it may also be worth asking whether they can include the error source and stage in the response body. Then you could read them from body right away.