Optionalmessage: stringOptional human-readable reason (logged, not routed on)
Readonly__type__Runtime brand (Symbol.for — survives duplicated module instances)
Static OptionalprepareOptional override for formatting stack traces
OptionalstackStaticstackStaticcaptureCreate .stack property on a target object
OptionalconstructorOpt: FunctionStaticfromNominal 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).
Any thrown object
a new OrderDeletedError with the original message, or a default message if the original was not a string
StaticisNominal 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).
Any thrown object
true when the object carries the OrderDeletedError brand
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).
Where to throw it
Only from the ORDER CHECKS (the
onOrderCheckping channel), i.e. any of:Broker.useBrokerAdapter→onOrderActiveCheck/onOrderScheduleCheck;callbacks.onOrderCheck/ handlerIAction.orderCheck(deprecated channel);listenChecklistener.What the framework does
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:
errorEmitterfires.exitEmitterdoes 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.When it is appropriate
Throw ONLY on the exchange's definitive "order not found by
event.signalId" response. Two critical distinctions:commitActivateScheduledinstead — 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 viacommitCreateTakeProfit/commitCreateStopLossso the close carries the true closeReason, instead of collapsing it into a generic "closed".event.attemptincrements) before acting terminally. Reporting a blip as "deleted" kills a live position on the spot.Nuances
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 byinstanceof, 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.messageis optional and purely informational; routing depends only on the brand.Example