Error logging and debugging
Error logging configuration
Variables
Value
error:
# Configure details for each erro status code.
- when: =@ctx.response.status = 403
# Configure the error table and the data to log to the table,
# in the error section of the function.
operations:
- type: operation.upsert-merge
table: =@ctx.entity & "_error"
records:
'={ "id": @ctx.commandId, "type": "System Offline", "response": @ctx.response,
"request": @ctx.request, "user": @ctx.user, "solution": @ctx.solution,
"entity": @ctx.entity, "correlationId": @ctx.correlationId}'
timestamp: remoteSystemTimestamp # Call the error details from the dedicated error table in a datasource.
# Use the datasource to configure jigs to action the error, e.g. retry.
type: datasource.sqlite
options:
provider: DATA_PROVIDER_LOCAL
entities:
- entity: datasync-error
query: SELECT
id,
json_extract(err.data, '$.response.ok') as ok,
json_extract(err.data, '$.response.status') as status,
json_extract(err.data, '$.response.statusText') as statusText,
json_extract(err.data, '$.response.headers') as headers,
json_extract(err.data, '$.response.body') as body,
json_extract(err.data, '$.screen') as screen,
json_extract(err.data, '$.type') as type
FROM
[datasync-error] AS errLast updated
Was this helpful?