UNPKG

metaapi.cloud-sdk

Version:

SDK for MetaApi, a professional cloud forex API which includes MetaTrader REST API and MetaTrader websocket API. Supports both MetaTrader 5 (MT5) and MetaTrader 4 (MT4). CopyFactory copy trading API included. (https://metaapi.cloud)

39 lines (38 loc) 1.4 kB
/** * Process control signal which may be configured with instructions describing how to treat an error from the process */ declare class ControlSignal extends Error { options?: ControlSignal.Options; /** Cause error */ cause?: Error; /** * Constructs instance * @param options options */ constructor(options?: ControlSignal.Options); } declare namespace ControlSignal { /** Constructing options */ type Options = { /** Error the process failed with */ error?: Error; /** Overriden message */ message?: string; /** * What to do with the process * - `cancel` means the process will be canceled, but only if it was not rescheduled with new options * - `failover` means a some problem arised and the process should be failovered with throttle delay * - `stop` means the process should gracefully stop, and restart without throttle delays if it is still scheduled * @default "failover" */ action?: 'cancel' | 'failover' | 'stop'; /** * Overriden log message severity. Default behaviour: * - `error` when `error` field is specified * - `warn` otherwise, when the action is `failover` * - `info` otherwise */ severity?: 'error' | 'warn' | 'info' | 'debug'; }; } export default ControlSignal;