#[non_exhaustive]pub enum ClientError {
Show 13 variants
#[non_exhaustive] ConnectionFailed {
url: String,
reason: String,
},
RequestFailed(String),
#[non_exhaustive] Timeout {
timeout: Duration,
},
InvalidUrl(String),
AuthenticationFailed(String),
AuthorizationFailed(String),
#[non_exhaustive] WorkflowNotFound {
workflow_id: String,
},
#[non_exhaustive] WorkflowAlreadyExists {
workflow_id: String,
run_id: Option<String>,
},
InvalidInput(String),
InvalidResponse(String),
#[non_exhaustive] ServerError {
status: u16,
message: String,
},
Serialization(String),
Deserialization(String),
}Expand description
Errors that can occur during client operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
#[non_exhaustive]ConnectionFailed
Connection to server failed
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
RequestFailed(String)
Request failed
#[non_exhaustive]Timeout
Request timed out
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
InvalidUrl(String)
Invalid server URL
AuthenticationFailed(String)
Authentication failed
AuthorizationFailed(String)
Authorization failed
#[non_exhaustive]WorkflowNotFound
Workflow not found
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
#[non_exhaustive]WorkflowAlreadyExists
The workflow id is already in use: its run is still open, or a closed one the start’s reuse policy does not allow reusing.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
InvalidInput(String)
Invalid workflow input
InvalidResponse(String)
Invalid response from server
#[non_exhaustive]ServerError
Server returned an error
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
Serialization(String)
Serialization error
Deserialization(String)
Deserialization error
Implementations§
Source§impl ClientError
impl ClientError
Sourcepub fn connection_failed(
url: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn connection_failed( url: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a connection failed error
Sourcepub fn server_error(status: u16, message: impl Into<String>) -> Self
pub fn server_error(status: u16, message: impl Into<String>) -> Self
Create a server error
Sourcepub fn workflow_not_found(workflow_id: impl Into<String>) -> Self
pub fn workflow_not_found(workflow_id: impl Into<String>) -> Self
Create a workflow not found error
Sourcepub fn workflow_already_exists(workflow_id: impl Into<String>) -> Self
pub fn workflow_already_exists(workflow_id: impl Into<String>) -> Self
Create a workflow already exists error
Sourcepub fn workflow_already_exists_with_run(
workflow_id: impl Into<String>,
run_id: impl Into<String>,
) -> Self
pub fn workflow_already_exists_with_run( workflow_id: impl Into<String>, run_id: impl Into<String>, ) -> Self
Create a workflow already exists error naming the run in the way
Sourcepub fn request_failed(reason: impl Into<String>) -> Self
pub fn request_failed(reason: impl Into<String>) -> Self
Create a request failed error
Sourcepub fn serialization(reason: impl Into<String>) -> Self
pub fn serialization(reason: impl Into<String>) -> Self
Create a serialization error
Sourcepub fn deserialization(reason: impl Into<String>) -> Self
pub fn deserialization(reason: impl Into<String>) -> Self
Create a deserialization error
Trait Implementations§
Source§impl Clone for ClientError
impl Clone for ClientError
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
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 From<ClientError> for Error
impl From<ClientError> for Error
Source§fn from(source: ClientError) -> Self
fn from(source: ClientError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for ClientError
impl Freeze for ClientError
impl Move for ClientError
impl RefUnwindSafe for ClientError
impl Send for ClientError
impl Sync for ClientError
impl Unpin for ClientError
impl UnsafeUnpin for ClientError
impl UnwindSafe for ClientError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request