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 + Send + Sync>,
},
Identity(String),
Internal(String),
Caused {
context: String,
source: Arc<dyn Error + Send + Sync>,
},
}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()
Source§impl From<Error> for PhotonError
impl From<Error> for PhotonError
Source§fn from(err: Error) -> PhotonError
fn from(err: Error) -> PhotonError
Source§impl From<Error> for PhotonError
impl From<Error> for PhotonError
Source§fn from(err: Error) -> PhotonError
fn from(err: Error) -> PhotonError
Source§impl From<IdentityError> for PhotonError
impl From<IdentityError> for PhotonError
Source§fn from(err: IdentityError) -> PhotonError
fn from(err: IdentityError) -> PhotonError
Auto Trait Implementations§
impl !RefUnwindSafe for PhotonError
impl !UnwindSafe for PhotonError
impl Freeze for PhotonError
impl Send for PhotonError
impl Sync for PhotonError
impl Unpin for PhotonError
impl UnsafeUnpin for PhotonError
Blanket Implementations§
impl<T> AsyncConnector for T
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more