pub struct WireError {
pub code: WireErrorCode,
pub message: String,
pub error_type: Option<String>,
}Expand description
Wire-safe error value. code is stable; message is informational only.
Fields§
§code: WireErrorCodeStable client-branchable error code.
message: StringHuman-readable informational message.
error_type: Option<String>Concrete typed error variant, when the server can expose one safely.
Implementations§
Source§impl WireError
impl WireError
Sourcepub fn new(code: WireErrorCode, message: impl Into<String>) -> Self
pub fn new(code: WireErrorCode, message: impl Into<String>) -> Self
Creates a wire error with the supplied stable code and informational message.
Sourcepub fn with_error_type(self, error_type: impl Into<String>) -> Self
pub fn with_error_type(self, error_type: impl Into<String>) -> Self
Attach a concrete typed error variant name to this wire error.
Sourcepub fn with_optional_error_type(self, error_type: Option<String>) -> Self
pub fn with_optional_error_type(self, error_type: Option<String>) -> Self
Attach an optional concrete typed error variant name to this wire error.
Sourcepub fn new_with_type(
code: WireErrorCode,
error_type: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn new_with_type( code: WireErrorCode, error_type: impl Into<String>, message: impl Into<String>, ) -> Self
Creates a wire error with a concrete typed error variant name.
Sourcepub fn namespace_denied(message: impl Into<String>) -> Self
pub fn namespace_denied(message: impl Into<String>) -> Self
Namespace authorization failure.
Sourcepub fn sequence_conflict(message: impl Into<String>) -> Self
pub fn sequence_conflict(message: impl Into<String>) -> Self
Durable sequence conflict failure.
Sourcepub fn unknown_query(message: impl Into<String>) -> Self
pub fn unknown_query(message: impl Into<String>) -> Self
Unknown workflow query failure.
Sourcepub fn query_timeout(message: impl Into<String>) -> Self
pub fn query_timeout(message: impl Into<String>) -> Self
Query timeout failure.
Sourcepub fn not_running(message: impl Into<String>) -> Self
pub fn not_running(message: impl Into<String>) -> Self
Workflow not-running failure.
Sourcepub fn invalid_input(message: impl Into<String>) -> Self
pub fn invalid_input(message: impl Into<String>) -> Self
Invalid input failure.
Sourcepub fn query_failed(message: impl Into<String>) -> Self
pub fn query_failed(message: impl Into<String>) -> Self
Query-handler application-level failure.
Sourcepub fn deploy_denied(message: impl Into<String>) -> Self
pub fn deploy_denied(message: impl Into<String>) -> Self
Deploy authorization failure.
Sourcepub fn version_pinned(message: impl Into<String>) -> Self
pub fn version_pinned(message: impl Into<String>) -> Self
Deploy version-pinned refusal.
Sourcepub fn not_found_with_type(
error_type: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn not_found_with_type( error_type: impl Into<String>, message: impl Into<String>, ) -> Self
Not-found failure with a concrete typed error variant name.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WireError
impl<'de> Deserialize<'de> for WireError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for WireError
Source§impl Error for WireError
impl Error for WireError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()