fix: make sentry dep optional
This commit is contained in:
@@ -37,7 +37,7 @@ async-std = { version = "1.8.0", features = [
|
|||||||
|
|
||||||
# core
|
# core
|
||||||
authifier = { version = "1.0.15" }
|
authifier = { version = "1.0.15" }
|
||||||
revolt-result = { path = "../core/result" }
|
revolt-result = { path = "../core/result", features = ["sentry"] }
|
||||||
revolt-models = { path = "../core/models" }
|
revolt-models = { path = "../core/models" }
|
||||||
revolt-config = { path = "../core/config" }
|
revolt-config = { path = "../core/config" }
|
||||||
revolt-database = { path = "../core/database" }
|
revolt-database = { path = "../core/database" }
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ aws-sdk-s3 = { version = "1.46.0", features = ["behavior-version-latest"] }
|
|||||||
revolt-config = { version = "0.8.8", path = "../config", features = [
|
revolt-config = { version = "0.8.8", path = "../config", features = [
|
||||||
"report-macros",
|
"report-macros",
|
||||||
] }
|
] }
|
||||||
revolt-result = { version = "0.8.8", path = "../result" }
|
revolt-result = { version = "0.8.8", path = "../result", features = ["sentry"] }
|
||||||
|
|
||||||
# image processing
|
# image processing
|
||||||
jxl-oxide = "0.8.1"
|
jxl-oxide = "0.8.1"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ utoipa = ["dep:utoipa"]
|
|||||||
rocket = ["dep:rocket", "dep:serde_json"]
|
rocket = ["dep:rocket", "dep:serde_json"]
|
||||||
axum = ["dep:axum", "dep:serde_json"]
|
axum = ["dep:axum", "dep:serde_json"]
|
||||||
okapi = ["dep:revolt_rocket_okapi", "dep:revolt_okapi", "schemas"]
|
okapi = ["dep:revolt_rocket_okapi", "dep:revolt_okapi", "schemas"]
|
||||||
|
sentry = ["dep:sentry"]
|
||||||
|
|
||||||
default = ["serde"]
|
default = ["serde"]
|
||||||
|
|
||||||
@@ -36,4 +37,4 @@ revolt_okapi = { version = "0.9.1", optional = true }
|
|||||||
axum = { version = "0.7.5", optional = true }
|
axum = { version = "0.7.5", optional = true }
|
||||||
|
|
||||||
# Sentry
|
# Sentry
|
||||||
sentry = "0.31.5"
|
sentry = { version = "0.31.5", optional = true }
|
||||||
@@ -213,7 +213,12 @@ pub trait ToRevoltError<T>: Sized {
|
|||||||
|
|
||||||
impl<T, E: std::error::Error> ToRevoltError<T> for Result<T, E> {
|
impl<T, E: std::error::Error> ToRevoltError<T> for Result<T, E> {
|
||||||
fn capture_error(self) -> Self {
|
fn capture_error(self) -> Self {
|
||||||
self.inspect_err(|e| { sentry::capture_error(e); })
|
|
||||||
|
#[allow(unused_variables)]
|
||||||
|
self.inspect_err(|e| {
|
||||||
|
#[cfg(feature = "sentry")]
|
||||||
|
sentry::capture_error(e);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
@@ -233,7 +238,11 @@ impl<T, E: std::error::Error> ToRevoltError<T> for Result<T, E> {
|
|||||||
|
|
||||||
impl<T: std::error::Error> ToRevoltError<T> for Option<T> {
|
impl<T: std::error::Error> ToRevoltError<T> for Option<T> {
|
||||||
fn capture_error(self) -> Self {
|
fn capture_error(self) -> Self {
|
||||||
self.inspect(|e| { sentry::capture_error(e); })
|
#[allow(unused_variables)]
|
||||||
|
self.inspect(|e| {
|
||||||
|
#[cfg(feature = "sentry")]
|
||||||
|
sentry::capture_error(e);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ revolt-models = { path = "../core/models", features = [
|
|||||||
"rocket",
|
"rocket",
|
||||||
] }
|
] }
|
||||||
revolt-presence = { path = "../core/presence" }
|
revolt-presence = { path = "../core/presence" }
|
||||||
revolt-result = { path = "../core/result", features = ["rocket", "okapi"] }
|
revolt-result = { path = "../core/result", features = ["rocket", "okapi", "sentry"] }
|
||||||
revolt-permissions = { path = "../core/permissions", features = ["schemas"] }
|
revolt-permissions = { path = "../core/permissions", features = ["schemas"] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
|
|||||||
Reference in New Issue
Block a user