Struct slack_morphism::errors::SlackClientSystemError
source · pub struct SlackClientSystemError {
pub message: Option<String>,
pub cause: Option<Box<dyn Error + Sync + Send + 'static>>,
}Fields§
§message: Option<String>§cause: Option<Box<dyn Error + Sync + Send + 'static>>Implementations§
source§impl SlackClientSystemError
impl SlackClientSystemError
sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
More examples
src/socket_mode/callbacks.rs (line 121)
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
async fn empty_command_events_callback(
event: SlackCommandEvent,
_client: Arc<SlackClient<SCHC>>,
_states: SlackClientEventsUserState,
) -> Result<SlackCommandEventResponse, Box<dyn std::error::Error + Send + Sync>> {
warn!("No callback is specified for a command event: {:?}", event);
Err(Box::new(SlackClientError::SystemError(
SlackClientSystemError::new()
.with_message("No callback is specified for a command event".to_string()),
)))
}
pub fn with_interaction_events<F>(
mut self,
interaction_events_fn: UserCallbackFunction<SlackInteractionEvent, F, SCHC>,
) -> Self
where
F: Future<Output = UserCallbackResult<()>> + Send + 'static,
{
self.interaction_callback = Box::new(interaction_events_fn);
self
}
async fn empty_interaction_events_callback(
event: SlackInteractionEvent,
_client: Arc<SlackClient<SCHC>>,
_states: SlackClientEventsUserState,
) -> UserCallbackResult<()> {
warn!(
"No callback is specified for interactive events: {:?}",
event
);
Err(Box::new(SlackClientError::SystemError(
SlackClientSystemError::new()
.with_message("No callback is specified for interactive events".to_string()),
)))
}
pub fn with_push_events<F>(
mut self,
push_events_fn: UserCallbackFunction<SlackPushEventCallback, F, SCHC>,
) -> Self
where
F: Future<Output = UserCallbackResult<()>> + Send + 'static,
{
self.push_events_callback = Box::new(push_events_fn);
self
}
async fn empty_push_events_callback(
event: SlackPushEventCallback,
_client: Arc<SlackClient<SCHC>>,
_states: SlackClientEventsUserState,
) -> UserCallbackResult<()> {
warn!("No callback is specified for a push event: {:?}", event);
Err(Box::new(SlackClientError::SystemError(
SlackClientSystemError::new()
.with_message("No callback is specified for push events".to_string()),
)))
}pub fn message(&mut self, value: String) -> &mut Self
pub fn reset_message(&mut self) -> &mut Self
pub fn mopt_message(&mut self, value: Option<String>) -> &mut Self
sourcepub fn with_message(self, value: String) -> Self
pub fn with_message(self, value: String) -> Self
Examples found in repository?
src/socket_mode/callbacks.rs (line 122)
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
async fn empty_command_events_callback(
event: SlackCommandEvent,
_client: Arc<SlackClient<SCHC>>,
_states: SlackClientEventsUserState,
) -> Result<SlackCommandEventResponse, Box<dyn std::error::Error + Send + Sync>> {
warn!("No callback is specified for a command event: {:?}", event);
Err(Box::new(SlackClientError::SystemError(
SlackClientSystemError::new()
.with_message("No callback is specified for a command event".to_string()),
)))
}
pub fn with_interaction_events<F>(
mut self,
interaction_events_fn: UserCallbackFunction<SlackInteractionEvent, F, SCHC>,
) -> Self
where
F: Future<Output = UserCallbackResult<()>> + Send + 'static,
{
self.interaction_callback = Box::new(interaction_events_fn);
self
}
async fn empty_interaction_events_callback(
event: SlackInteractionEvent,
_client: Arc<SlackClient<SCHC>>,
_states: SlackClientEventsUserState,
) -> UserCallbackResult<()> {
warn!(
"No callback is specified for interactive events: {:?}",
event
);
Err(Box::new(SlackClientError::SystemError(
SlackClientSystemError::new()
.with_message("No callback is specified for interactive events".to_string()),
)))
}
pub fn with_push_events<F>(
mut self,
push_events_fn: UserCallbackFunction<SlackPushEventCallback, F, SCHC>,
) -> Self
where
F: Future<Output = UserCallbackResult<()>> + Send + 'static,
{
self.push_events_callback = Box::new(push_events_fn);
self
}
async fn empty_push_events_callback(
event: SlackPushEventCallback,
_client: Arc<SlackClient<SCHC>>,
_states: SlackClientEventsUserState,
) -> UserCallbackResult<()> {
warn!("No callback is specified for a push event: {:?}", event);
Err(Box::new(SlackClientError::SystemError(
SlackClientSystemError::new()
.with_message("No callback is specified for push events".to_string()),
)))
}pub fn without_message(self) -> Self
pub fn opt_message(self, value: Option<String>) -> Self
pub fn cause(
&mut self,
value: Box<dyn Error + Sync + Send + 'static>
) -> &mut Self
pub fn reset_cause(&mut self) -> &mut Self
pub fn mopt_cause(
&mut self,
value: Option<Box<dyn Error + Sync + Send + 'static>>
) -> &mut Self
pub fn without_cause(self) -> Self
pub fn opt_cause(
self,
value: Option<Box<dyn Error + Sync + Send + 'static>>
) -> Self
Trait Implementations§
source§impl Debug for SlackClientSystemError
impl Debug for SlackClientSystemError
source§impl Display for SlackClientSystemError
impl Display for SlackClientSystemError
source§impl Error for SlackClientSystemError
impl Error for SlackClientSystemError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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<SlackClientSystemErrorInit> for SlackClientSystemError
impl From<SlackClientSystemErrorInit> for SlackClientSystemError
source§fn from(value: SlackClientSystemErrorInit) -> Self
fn from(value: SlackClientSystemErrorInit) -> Self
Converts to this type from the input type.