Skip to content

Commit

Permalink
Merge pull request mlua-rs#167 from LPGhatguy/undo-my-error-misunders…
Browse files Browse the repository at this point in the history
…tanding

Update CallbackError and ExternalError Display impl to match recommendations
  • Loading branch information
kyren authored Mar 17, 2020
2 parents 4e471df + 499169b commit b1ddd2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ impl fmt::Display for Error {
Error::MismatchedRegistryKey => {
write!(fmt, "RegistryKey used from different Lua state")
}
Error::CallbackError { ref traceback, ref cause } => {
write!(fmt, "callback error: {}: {}", cause, traceback)
Error::CallbackError { ref traceback, .. } => {
write!(fmt, "callback error: {}", traceback)
}
Error::ExternalError(ref err) => write!(fmt, "external error: {}", err),
Error::ExternalError(ref err) => write!(fmt, "{}", err),
}
}
}
Expand All @@ -194,7 +194,7 @@ impl StdError for Error {
fn source(&self) -> Option<&(dyn StdError + 'static)> {
match *self {
Error::CallbackError { ref cause, .. } => Some(cause.as_ref()),
Error::ExternalError(ref err) => Some(err.as_ref()),
Error::ExternalError(ref err) => err.source(),
_ => None,
}
}
Expand Down

0 comments on commit b1ddd2b

Please sign in to comment.