Error
The configuration is located in /error/config.ion.
The configuration file itself is optional.
All properties in the configuration file are also optional.
Project config files inherit properties from tenant config files which inherit from the global defaults as given below.
See URL Connections for detailed description of the connection configuration.
Matching Connections to URLs
The error worker will send HTTP requests to notify success of priint cloud rendering jobs.
The project configuration contains a list of connection configurations identified by their url property. Typically, just one.
The best matching configuration is the configuration with the longest matching URL part (computed from the start of the URL).
If no matching configuration is found the system falls back to a default configuration.
Typical Project Configuration Example
// /tenants/example.com/projects/datasheets/error/config.ion
{
"connections": [{
"method": "POST",
"url": "https://example.com/notfications/priint-error",
"authentication": {
"type": "ApiKey",
"key": "API-KEY",
"value": "8e104bcc93c9f7af5626bbfae2c0295eced7d86985b90f639e8844"
},
"payload": [{
"value" : "{\"status\":\"success\",\"ticket\":\"{ticket}\"}"
}]
}]
}
Together with a errorUrl setting of https://example.com/notfications/priint-error/{ticket} in /restapi/config.ion this configuration will lead to an HTTP Request like this:
POST /notifications/priint-error/u6g3fzzv36nzswjdb6dzdiuvpy HTTP/1.1
Host: https://example.com
API-KEY: 8e104bcc93c9f7af5626bbfae2c0295eced7d86985b90f639e8844
Content-type: application/json
User-agent: priintgrid-error
Content-length: 395
{"status":"failed","ticket":"u6g3fzzv36nzswjdb6dzdiuvpy","message":"${errorMessage}"}
Default Behavior
If error worker does only find a white-listed URL in the config, then the system falls back to a default request.
Given the hypothetical renderpdf request like
POST /tenants/example.com/projects/datasheets/renderpdf
?custom=foo:bar
&foreignKey=0815
&error=https://example.com/notifications/priint-error/%7Bticket%7D
and a user "datasheet-jobs" job ticket of "u6g3fzzv36nzswjdb6dzdiuvpy"
and a very simple configuration like
// /tenants/example.com/projects/datasheets/error/config.ion
{
"connections": [{
"url": "https://example.com/"
}]}
we get the following request to the error URL:
POST /notifications/priint-error/u6g3fzzv36nzswjdb6dzdiuvpy HTTP/1.1
Host: https://example.com
Content-type: application/json
User-agent: priintgrid-error
Content-length: 395
{
"foo" : "bar",
"tenant" : "example.com",
"project" : "datasheets",
"user" : "datasheet-jobs",
"ticket" : "u6g3fzzv36nzswjdb6dzdiuvpy",
"outputType" : "pdf",
"foreignKey" : "0815",
"errorMessage" : "some error message",
"dateTime" : "2023-10-13T17:59:44.424+02:00",
"timestamp" : "1697212784424"
}