File tree 1 file changed +10
-1
lines changed 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
use eyre:: EyreHandler ;
2
2
use std:: error:: Error ;
3
+ use tracing:: error;
3
4
use yansi:: Paint ;
4
5
5
6
/// A custom context type for Foundry specific error reporting via `eyre`
@@ -47,6 +48,7 @@ impl EyreHandler for Handler {
47
48
/// verbose debug-centric handler is installed.
48
49
///
49
50
/// Panics are always caught by the more debug-centric handler.
51
+ #[ cfg_attr( windows, inline( never) ) ]
50
52
pub fn install ( ) -> eyre:: Result < ( ) > {
51
53
let debug_enabled = std:: env:: var ( "FOUNDRY_DEBUG" ) . is_ok ( ) ;
52
54
@@ -59,7 +61,14 @@ pub fn install() -> eyre::Result<()> {
59
61
)
60
62
. into_hooks ( ) ;
61
63
panic_hook. install ( ) ;
62
- eyre:: set_hook ( Box :: new ( move |_| Box :: new ( Handler ) ) ) ?;
64
+ // see <https://github.com/foundry-rs/foundry/issues/3050>
65
+ if cfg ! ( windows) {
66
+ if let Err ( err) = eyre:: set_hook ( Box :: new ( move |_| Box :: new ( Handler ) ) ) {
67
+ error ! ( ?err, "failed to install panic hook" ) ;
68
+ }
69
+ } else {
70
+ eyre:: set_hook ( Box :: new ( move |_| Box :: new ( Handler ) ) ) ?;
71
+ }
63
72
}
64
73
65
74
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments