Extends Error
CONFIRMED order-not-found — "the exchange definitively reports there is no order under this id anymore" (e.g. the user cancelled it manually on the exchange, or it was liquidated / garbage-collected externally).
Only from the ORDER CHECKS (the onOrderCheck ping channel), i.e. any of:
Broker.useBrokerAdapter → onOrderActiveCheck / onOrderScheduleCheck;callbacks.onOrderCheck / handler IAction.orderCheck (deprecated channel);listenCheck listener.The throw propagates UNWRAPPED through every layer (the runtime brand survives)
and resolves into the IBrokerOrderVerdict { reason: "deleted" } — terminal
IMMEDIATELY, bypassing the CC_ORDER_CHECK_RETRY_ATTEMPTS tolerance counter:
event.type === "active" (open position): the position is closed with
closeReason "closed" WITHOUT re-confirmation through the close gate — the ping
already established the order is gone, re-asking the broker would be redundant.event.type === "schedule" (resting entry order): the scheduled signal is
cancelled with reason "user". The schedule-cancelled lifecycle event still
reaches the broker adapter (onSignalScheduleCancelled); cancelling an
already-gone order there is a no-op.Loudness: errorEmitter fires. exitEmitter does NOT fire — a confirmed
not-found is a business fact about ONE order, not a fatal network condition.
Compare with transient-failure exhaustion of the same check, which DOES signal
a fatal exit.
Throw ONLY on the exchange's definitive "order not found by event.signalId"
response. Two critical distinctions:
commitActivateScheduled instead — a throw here
is a terminal CANCEL, not an activation. Same for an open position whose TP/SL
order filled on the exchange: report it via commitCreateTakeProfit /
commitCreateStopLoss so the close carries the true closeReason, instead of
collapsing it into a generic "closed".event.attempt increments) before acting
terminally. Reporting a blip as "deleted" kills a live position on the spot.onOrderOpenCommit / onOrderCloseCommit / callbacks.onOrderSync) is a
userspace protocol violation: it is INTENTIONALLY degraded to the "transient"
verdict (bounded retry) instead of being honored as terminal.__type__ === Symbol.for("OrderDeletedError") brand via the static guard —
never by instanceof, so it survives duplicated module instances across bundles.event.attempt) to 0;
this error ignores the counter entirely in both directions — it neither needs
prior failures nor is delayed by remaining tolerance.message is optional and purely informational; routing depends only on the
brand.constructor(message: string);
__type__: symbol
Runtime brand (Symbol.for — survives duplicated module instances)
static isOrderDeletedError(error: object): boolean;
Nominal type guard by the runtime brand. Use this instead of instanceof:
the check is based on Symbol.for, so it recognizes instances created by a
DIFFERENT copy of this module (duplicated bundles, linked packages).
static fromError(error: object): OrderDeletedError;
Nominal constructor for a new OrderDeletedError from any thrown object. Use this
instead of instanceof to recognize instances created by a DIFFERENT copy of
this module (duplicated bundles, linked packages).