Skip to content

Commit

Permalink
Another attempt to improve coverage of errors.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
Finomnis committed Oct 22, 2023
1 parent 9de8b95 commit e0ddd1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ impl<ErrType: ErrTypeTraits> SubsystemError<ErrType> {
/// [`cancel_on_shutdown()`](crate::FutureExt::cancel_on_shutdown).
#[derive(Error, Debug, Diagnostic)]
#[error("A shutdown request caused this task to be cancelled")]
#[diagnostic(code(graceful_shutdown::future::cancelled_by_shutdown))]
pub struct CancelledByShutdown;

#[cfg(test)]
Expand Down
2 changes: 2 additions & 0 deletions src/errors/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ fn examine_report(
) {
println!("{}", error);
println!("{:?}", error);
println!("{:?}", error.source());
println!("{}", error.code().unwrap());
// Convert to report
let report: miette::Report = error.into();
println!("{}", report);
Expand Down

0 comments on commit e0ddd1b

Please sign in to comment.