UNPKG

arvo-core

Version:

This core package contains all the core classes and components of the Arvo Event Driven System

44 lines (43 loc) 1.98 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.ViolationError = void 0; /** * ViolationError represents errors that require explicit handling in the system. * These are distinct from recoverable errors that can be automatically handled * by workflow logic. The explicit handling may be required for severe * violation of service contracts or explict retry handling * * Common violation scenarios include: * - Execution error like rate limit exceeded on external API calls * - Contract violations (invalid input/output) * - Configuration errors * - Permission/authorization failures */ var ViolationError = /** @class */ (function (_super) { __extends(ViolationError, _super); function ViolationError(_a) { var type = _a.type, message = _a.message, metadata = _a.metadata; var _this = _super.call(this, "ViolationError<".concat(type, "> ").concat(message)) || this; _this.type = type; _this.name = "ViolationError<".concat(_this.type, ">"); _this.metadata = metadata !== null && metadata !== void 0 ? metadata : null; return _this; } return ViolationError; }(Error)); exports.ViolationError = ViolationError;