pub enum PhotonError {
Show 13 variants
TopicNotFound(String),
SubscriptionNotFound(String),
EventNotFound(String),
InvalidTopicName(String),
PayloadError(String),
SchemaMismatch(String),
TopicAlreadyExists(String),
SubscriptionNameRequired,
PersistenceError(String),
Persistence {
context: String,
source: Arc<dyn Error + Sync + Send>,
},
Identity(String),
Internal(String),
Caused {
context: String,
source: Arc<dyn Error + Sync + Send>,
},
}Expand description
Errors that can occur in Photon operations.
Variants§
TopicNotFound(String)
Topic not found in registry.
SubscriptionNotFound(String)
Subscription not found.
EventNotFound(String)
Event not found.
InvalidTopicName(String)
Invalid topic name.
PayloadError(String)
Payload serialization/deserialization error.
SchemaMismatch(String)
Schema mismatch at publish time.
TopicAlreadyExists(String)
Topic already registered with different schema.
SubscriptionNameRequired
Subscription name required for durable subscriptions.
PersistenceError(String)
use PhotonError::persistence(…) for sourced failures
Persistence / store error (ops metadata adapters).
Prefer PhotonError::persistence when an underlying store error exists.
Persistence
Persistence failure with preserved source chain.
Fields
Identity(String)
Identity reconstruction failed at the handler boundary.
Produced when photon_core::IdentityFactory::reconstruct rejects actor JSON
(or a typed-actor downcast fails). Executor maps this to
crate::instrumentation::FailureReason::IdentityBuild.
Internal(String)
Internal error (opaque message, no source chain).
Caused
Internal failure with preserved source chain.
Implementations§
Source§impl PhotonError
impl PhotonError
Sourcepub fn caused(
context: impl Into<String>,
err: impl Display + Send + Sync + 'static,
) -> PhotonError
pub fn caused( context: impl Into<String>, err: impl Display + Send + Sync + 'static, ) -> PhotonError
Internal error with a source chain (broker I/O, crypto, etc.).
Accepts any std::fmt::Display value so callers can wrap SDK errors that do not
implement std::error::Error (e.g. some AEAD/crypto error types).
Sourcepub fn caused_error(
context: impl Into<String>,
err: impl Error + Send + Sync + 'static,
) -> PhotonError
pub fn caused_error( context: impl Into<String>, err: impl Error + Send + Sync + 'static, ) -> PhotonError
Internal error wrapping a real std::error::Error source chain.
Sourcepub fn persistence(
context: impl Into<String>,
err: impl Error + Send + Sync + 'static,
) -> PhotonError
pub fn persistence( context: impl Into<String>, err: impl Error + Send + Sync + 'static, ) -> PhotonError
Persistence error with a source chain.
Trait Implementations§
Source§impl Clone for PhotonError
impl Clone for PhotonError
Source§fn clone(&self) -> PhotonError
fn clone(&self) -> PhotonError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PhotonError
impl Debug for PhotonError
Source§impl Display for PhotonError
impl Display for PhotonError
Source§impl Error for PhotonError
impl Error for PhotonError
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()