pub enum PubSubError {
Show 21 variants
PublishError {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
SubscriptionError {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
AcknowledgmentError {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
BatchingError {
message: String,
batch_size: usize,
},
FlowControlError {
message: String,
current_count: usize,
max_count: usize,
},
DeadLetterQueueError {
message: String,
message_id: String,
},
OrderingKeyError {
message: String,
ordering_key: String,
},
AuthenticationError {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
ConfigurationError {
message: String,
parameter: String,
},
TopicNotFound {
topic_name: String,
},
SubscriptionNotFound {
subscription_name: String,
},
MessageTooLarge {
size: usize,
max_size: usize,
},
InvalidMessageFormat {
message: String,
},
Timeout {
duration_ms: u64,
},
NetworkError {
message: String,
source: Option<Box<dyn Error + Send + Sync>>,
},
ResourceExhausted {
resource: String,
retry_after: Option<u64>,
},
PermissionDenied {
operation: String,
},
InternalError {
message: String,
},
Io(Error),
Json(Error),
ClientError(String),
}Expand description
Errors that can occur during Pub/Sub operations.
Variants§
PublishError
Error during message publishing.
Fields
SubscriptionError
Error during message subscription.
Fields
AcknowledgmentError
Error during message acknowledgment.
Fields
BatchingError
Batching error.
FlowControlError
Flow control error.
Fields
DeadLetterQueueError
Dead letter queue error.
OrderingKeyError
Ordering key error.
AuthenticationError
Authentication error.
Fields
ConfigurationError
Configuration error.
TopicNotFound
Topic not found error.
SubscriptionNotFound
Subscription not found error.
MessageTooLarge
Message too large error.
InvalidMessageFormat
Invalid message format.
Timeout
Timeout error.
NetworkError
Network error.
Fields
ResourceExhausted
Resource exhausted error.
Fields
PermissionDenied
Permission denied error.
InternalError
Internal error.
Io(Error)
I/O error.
Json(Error)
JSON serialization/deserialization error.
ClientError(String)
Google Cloud Pub/Sub client error.
Implementations§
Source§impl PubSubError
impl PubSubError
Sourcepub fn publish_with_source<S: Into<String>>(
message: S,
source: Box<dyn Error + Send + Sync>,
) -> Self
pub fn publish_with_source<S: Into<String>>( message: S, source: Box<dyn Error + Send + Sync>, ) -> Self
Creates a publish error with a source error.
Sourcepub fn subscription<S: Into<String>>(message: S) -> Self
pub fn subscription<S: Into<String>>(message: S) -> Self
Creates a subscription error from a message.
Sourcepub fn subscription_with_source<S: Into<String>>(
message: S,
source: Box<dyn Error + Send + Sync>,
) -> Self
pub fn subscription_with_source<S: Into<String>>( message: S, source: Box<dyn Error + Send + Sync>, ) -> Self
Creates a subscription error with a source error.
Sourcepub fn acknowledgment<S: Into<String>>(message: S) -> Self
pub fn acknowledgment<S: Into<String>>(message: S) -> Self
Creates an acknowledgment error from a message.
Sourcepub fn configuration<S: Into<String>, P: Into<String>>(
message: S,
parameter: P,
) -> Self
pub fn configuration<S: Into<String>, P: Into<String>>( message: S, parameter: P, ) -> Self
Creates a configuration error.
Sourcepub fn batching<S: Into<String>>(message: S, batch_size: usize) -> Self
pub fn batching<S: Into<String>>(message: S, batch_size: usize) -> Self
Creates a batching error.
Sourcepub fn flow_control<S: Into<String>>(
message: S,
current_count: usize,
max_count: usize,
) -> Self
pub fn flow_control<S: Into<String>>( message: S, current_count: usize, max_count: usize, ) -> Self
Creates a flow control error.
Sourcepub fn dead_letter<S: Into<String>, M: Into<String>>(
message: S,
message_id: M,
) -> Self
pub fn dead_letter<S: Into<String>, M: Into<String>>( message: S, message_id: M, ) -> Self
Creates a dead letter queue error.
Sourcepub fn ordering_key<S: Into<String>, K: Into<String>>(
message: S,
ordering_key: K,
) -> Self
pub fn ordering_key<S: Into<String>, K: Into<String>>( message: S, ordering_key: K, ) -> Self
Creates an ordering key error.
Sourcepub fn topic_not_found<S: Into<String>>(topic_name: S) -> Self
pub fn topic_not_found<S: Into<String>>(topic_name: S) -> Self
Creates a topic not found error.
Sourcepub fn subscription_not_found<S: Into<String>>(subscription_name: S) -> Self
pub fn subscription_not_found<S: Into<String>>(subscription_name: S) -> Self
Creates a subscription not found error.
Sourcepub fn message_too_large(size: usize, max_size: usize) -> Self
pub fn message_too_large(size: usize, max_size: usize) -> Self
Creates a message too large error.
Sourcepub fn resource_exhausted<S: Into<String>>(
resource: S,
retry_after: Option<u64>,
) -> Self
pub fn resource_exhausted<S: Into<String>>( resource: S, retry_after: Option<u64>, ) -> Self
Creates a resource exhausted error.
Sourcepub fn permission_denied<S: Into<String>>(operation: S) -> Self
pub fn permission_denied<S: Into<String>>(operation: S) -> Self
Creates a permission denied error.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Checks if the error is retryable.
Sourcepub fn retry_after(&self) -> Option<u64>
pub fn retry_after(&self) -> Option<u64>
Gets the retry after duration if available.
Trait Implementations§
Source§impl Debug for PubSubError
impl Debug for PubSubError
Source§impl Display for PubSubError
impl Display for PubSubError
Source§impl Error for PubSubError
impl Error for PubSubError
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 PubSubError
impl From<Error> for PubSubError
Auto Trait Implementations§
impl Freeze for PubSubError
impl !RefUnwindSafe for PubSubError
impl Send for PubSubError
impl Sync for PubSubError
impl Unpin for PubSubError
impl UnsafeUnpin for PubSubError
impl !UnwindSafe for PubSubError
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
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>
T in a tonic::RequestSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.