pub struct ServerError {
pub message: String,
pub body: Option<String>,
pub receipt_id: Option<String>,
pub frame: Frame,
}Expand description
Represents an ERROR frame received from the STOMP server.
STOMP servers send ERROR frames to indicate protocol violations, authentication failures, or other server-side errors. After sending an ERROR frame, the server typically closes the connection.
§Example
ⓘ
use iridium_stomp::ReceivedFrame;
while let Some(received) = conn.next_frame().await {
match received {
ReceivedFrame::Frame(frame) => {
// Normal message processing
}
ReceivedFrame::Error(err) => {
eprintln!("Server error: {}", err.message);
if let Some(body) = &err.body {
eprintln!("Details: {}", body);
}
break;
}
}
}Fields§
§message: StringThe error message from the message header.
body: Option<String>The error body, if present. Contains additional error details.
receipt_id: Option<String>The receipt-id if this error is in response to a specific frame.
frame: FrameThe original ERROR frame for access to additional headers.
Implementations§
Source§impl ServerError
impl ServerError
Sourcepub fn from_frame(frame: Frame) -> Self
pub fn from_frame(frame: Frame) -> Self
Create a ServerError from an ERROR frame.
This is primarily used internally but is public for testing and
advanced use cases where you need to construct a ServerError manually.
Trait Implementations§
Source§impl Clone for ServerError
impl Clone for ServerError
Source§fn clone(&self) -> ServerError
fn clone(&self) -> ServerError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerError
impl Debug for ServerError
Source§impl Display for ServerError
impl Display for ServerError
Source§impl Error for ServerError
impl Error for ServerError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for ServerError
impl PartialEq for ServerError
impl Eq for ServerError
impl StructuralPartialEq for ServerError
Auto Trait Implementations§
impl Freeze for ServerError
impl RefUnwindSafe for ServerError
impl Send for ServerError
impl Sync for ServerError
impl Unpin for ServerError
impl UnsafeUnpin for ServerError
impl UnwindSafe for ServerError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more