-
-
Notifications
You must be signed in to change notification settings - Fork 243
Expand file tree
/
Copy pathmod.rs
More file actions
30 lines (23 loc) · 831 Bytes
/
mod.rs
File metadata and controls
30 lines (23 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
mod api_error;
mod sentry_error;
pub(super) use api_error::{ApiError, ApiErrorKind};
pub(super) use sentry_error::SentryError;
use crate::api::ApiResponse;
#[derive(Clone, Debug, thiserror::Error)]
#[error("project was renamed to '{0}'\nPlease use this slug in your .sentryclirc file, sentry.properties file or in the CLI --project parameter")]
pub(super) struct ProjectRenamedError(pub(super) String);
/// Shortcut alias for results of this module.
pub(super) type ApiResult<T> = Result<T, ApiError>;
#[derive(Debug, thiserror::Error)]
#[error("request failed with retryable status code {}", .body.status)]
pub(super) struct RetryError {
body: ApiResponse,
}
impl RetryError {
pub fn new(body: ApiResponse) -> Self {
Self { body }
}
pub fn into_body(self) -> ApiResponse {
self.body
}
}