Skip to content

policy.hook_failed

The gateway’s own event: an endpoint’s policy package hook failed (its code raised an error, ran out of its limits, or returned what a hook may not), or said to do what could not be done (an action that could not be started, a command that could not be queued, a job that could not be made). Nothing of what failed is done, and the hook is not asked again: this is the policy’s answer, for the builder to act on through their own systems. Told once for the hook and what it was about, however often it ran; the route hook, asked again each time its punch is worked out again, is told once per attempt that fails. The envelope’s endpoint and device are the moment’s (for route, the punch’s).

Schema id: urn:houradvantage:events:3:policy.hook_failed

Fields

FieldTypeRequiredDescription
hook"joined" \"moved" \"back" \
aboutstringyesThe id of the event the hook was about: the device.joined, device.moved or device.back event, the person.enrolled event, or the punch event (route).
packagestring or nullyesThe policy package’s name, as its tenant names it.
versionstring or nullyesThe policy package’s version that ran the hook.
errorstringyesWhat went wrong: the hook’s error, or each thing it said that could not be done, separated by ’; ’.
repeatbooleanTrue when the attempt before this one failed too: the route hook, asked again for a punch it had failed on. False otherwise.

Example

{
"hook": "joined",
"about": "0f3c2a9b8d7e6f5a4b3c2d1e0f9a8b7c",
"package": "clock-lifecycle",
"version": "1.0.1",
"error": "runtime error: main.lua:4: attempt to index a nil value (field 'labels')",
"repeat": false
}

JSON Schema

policy.hook_failed.json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:houradvantage:events:3:policy.hook_failed",
"title": "policy.hook_failed: data",
"description": "The gateway's own event: an endpoint's policy package hook failed (its code raised an error, ran out of its limits, or returned what a hook may not), or said to do what could not be done (an action that could not be started, a command that could not be queued, a job that could not be made). Nothing of what failed is done, and the hook is not asked again: this is the policy's answer, for the builder to act on through their own systems. Told once for the hook and what it was about, however often it ran; the route hook, asked again each time its punch is worked out again, is told once per attempt that fails. The envelope's endpoint and device are the moment's (for route, the punch's).",
"type": "object",
"properties": {
"hook": {
"description": "The hook: joined, moved, back, enrolled or route.",
"enum": [
"joined",
"moved",
"back",
"enrolled",
"route"
]
},
"about": {
"type": "string",
"description": "The id of the event the hook was about: the device.joined, device.moved or device.back event, the person.enrolled event, or the punch event (route)."
},
"package": {
"type": [
"string",
"null"
],
"description": "The policy package's name, as its tenant names it."
},
"version": {
"type": [
"string",
"null"
],
"description": "The policy package's version that ran the hook."
},
"error": {
"type": "string",
"description": "What went wrong: the hook's error, or each thing it said that could not be done, separated by '; '."
},
"repeat": {
"type": "boolean",
"description": "True when the attempt before this one failed too: the route hook, asked again for a punch it had failed on. False otherwise."
}
},
"required": [
"hook",
"about",
"package",
"version",
"error"
],
"examples": [
{
"hook": "joined",
"about": "0f3c2a9b8d7e6f5a4b3c2d1e0f9a8b7c",
"package": "clock-lifecycle",
"version": "1.0.1",
"error": "runtime error: main.lua:4: attempt to index a nil value (field 'labels')",
"repeat": false
}
]
}