Skip to content

Commit

Permalink
[#63] ExecuteError에 backtrace 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
myyrakle committed Mar 24, 2024
1 parent d68c4c2 commit 022d81b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/errors/execute_error.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
use super::RRDBError;

#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Debug)]
pub struct ExecuteError {
pub message: String,
pub backtrace: std::backtrace::Backtrace,
}

impl ExecuteError {
pub fn new<T: ToString>(message: T) -> RRDBError {
RRDBError::ExecuteError(Self {
message: message.to_string(),
backtrace: std::backtrace::Backtrace::capture(),
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/errors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub mod predule;
pub mod server_error;
pub mod type_error;

#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Debug)]
pub enum RRDBError {
ExecuteError(execute_error::ExecuteError),
IntoError(into_error::IntoError),
Expand Down

0 comments on commit 022d81b

Please sign in to comment.