WatchCheckFailedPayload watch.check.failed@1

Generated at from openvibe-contracts v0.107.0 and openvibe-sdk v0.26.0.

Version
1.0.0
Owner
watch
Visibility
first-party
Status
planned
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/watch.check.failed.v1.json

watch.check.failed v1 (OpenVibe.Watch, plan T18): a check ended in a failure state. consecutive_failures is how many runs in a row have failed, so a consumer can tell a blip from a watch that is down. Envelope: subject { type: watch, id: <watch_id> }, visibility internal, priority normal, actor service:watch.

Fields

FieldTypeRequiredDescriptionConstraints
watch_idstringyes
  • pattern ^wch_[0-9A-HJKMNP-TV-Z]{26}$
stateenumyes
  • one of "http_error", "timeout", "parse_error", "rate_limited", "budget_exceeded", "skipped", "disabled"
carrierenumyes
  • one of "event", "webhook", "http", "feed", "api", "node", "run", null
http_statusinteger | nullyes
error_codestring | nullyes
consecutive_failuresintegeryes
  • minimum 1

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: http-error
{
  "watch_id": "wch_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "state": "http_error",
  "carrier": "http",
  "http_status": 503,
  "error_code": "upstream_unavailable",
  "consecutive_failures": 2
}
Rejected: zero-failures
{
  "watch_id": "wch_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "state": "timeout",
  "carrier": "api",
  "http_status": null,
  "error_code": "deadline_exceeded",
  "consecutive_failures": 0
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('watch.check.failed@1', value);   // { valid, errors: [{ path, message }] }