Skip to content

Commit

Permalink
[#63] ServerError에 backtrace 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
myyrakle committed Mar 24, 2024
1 parent 4bc3ab6 commit a201cc1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/errors/server_error.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#[derive(Clone, Debug, PartialEq, Eq)]
#[derive(Debug)]
pub struct ServerError {
pub message: String,
pub backtrace: std::backtrace::Backtrace,
}

impl ServerError {
pub fn new<T: ToString>(message: T) -> Self {
Self {
message: message.to_string(),
backtrace: std::backtrace::Backtrace::capture(),
}
}

Expand Down

0 comments on commit a201cc1

Please sign in to comment.