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§

Examples found in repository?
src/errors.rs (line 205)
204
205
206
    fn from(err: Box<dyn Error + Sync + Send>) -> Self {
        SlackClientError::SystemError(SlackClientSystemError::new().with_cause(err))
    }
More examples
Hide additional 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()),
        )))
    }
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()),
        )))
    }
Examples found in repository?
src/errors.rs (line 205)
204
205
206
    fn from(err: Box<dyn Error + Sync + Send>) -> Self {
        SlackClientError::SystemError(SlackClientSystemError::new().with_cause(err))
    }

Trait Implementations§

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more