chore: add temp sentry logging system

This commit is contained in:
Zomatree
2025-10-22 21:28:01 +01:00
parent 20a4816235
commit db19957de5
4 changed files with 9 additions and 3 deletions

View File

@@ -226,7 +226,7 @@ pub trait ToRevoltError<T> {
fn to_internal_error(self) -> Result<T, Error>;
}
impl<T, E: std::fmt::Debug> ToRevoltError<T> for Result<T, E> {
impl<T, E: std::fmt::Debug + std::error::Error> ToRevoltError<T> for Result<T, E> {
#[track_caller]
fn to_internal_error(self) -> Result<T, Error> {
let loc = Location::caller();
@@ -234,6 +234,8 @@ impl<T, E: std::fmt::Debug> ToRevoltError<T> for Result<T, E> {
self
.map_err(|e| {
log::error!("{e:?}");
#[cfg(feature = "sentry")]
sentry::capture_error(&e);
Error {
error_type: ErrorType::InternalError,