pub struct Notice {
pub code: i32,
pub message: String,
pub error_time: Option<OffsetDateTime>,
}Expand description
An error message from the TWS API.
Fields§
§code: i32Error code reported by TWS.
message: StringHuman-readable error message text.
error_time: Option<OffsetDateTime>Timestamp when the error occurred. Only present for server versions >= ERROR_TIME (194).
Implementations§
Source§impl Notice
impl Notice
Sourcepub fn from(message: &ResponseMessage) -> Notice
pub fn from(message: &ResponseMessage) -> Notice
Construct a notice from a response message.
Sourcepub fn is_cancellation(&self) -> bool
pub fn is_cancellation(&self) -> bool
Returns true if this notice indicates an order was cancelled (code 202).
Code 202 is sent by TWS to confirm an order cancellation. This is an informational message, not an error.
Sourcepub fn is_warning(&self) -> bool
pub fn is_warning(&self) -> bool
Returns true if this is a warning message (codes 2100-2169).
Sourcepub fn is_system_message(&self) -> bool
pub fn is_system_message(&self) -> bool
Returns true if this is a system/connectivity message (codes 1100-1102, 1300).
System messages indicate connectivity status changes:
- 1100: Connectivity between IB and TWS lost
- 1101: Connectivity restored, market data lost (resubscribe needed)
- 1102: Connectivity restored, market data maintained
- 1300: Socket port reset during active connection
Sourcepub fn is_informational(&self) -> bool
pub fn is_informational(&self) -> bool
Returns true if this is an informational notice (not an error).
Informational notices include cancellation confirmations, warnings, and system/connectivity messages.