Skip to content

Commit 8153b1a

Browse files
authored
feat(unstable): Add a request cancelled error constructor (#347)
1 parent b3f3b48 commit 8153b1a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/error.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,20 @@ impl Error {
9292
ErrorCode::InternalError.into()
9393
}
9494

95+
/// **UNSTABLE**
96+
///
97+
/// This capability is not part of the spec yet, and may be removed or changed at any point.
98+
///
99+
/// Request was cancelled.
100+
///
101+
/// Execution of the method was aborted either due to a cancellation request from the caller
102+
/// or because of resource constraints or shutdown.
103+
#[cfg(feature = "unstable_cancel_request")]
104+
#[must_use]
105+
pub fn request_cancelled() -> Self {
106+
ErrorCode::RequestCancelled.into()
107+
}
108+
95109
/// Authentication required.
96110
#[must_use]
97111
pub fn auth_required() -> Self {

0 commit comments

Comments
 (0)