At the moment we’re the use of the todo!()(*5*) macro which is superb for simulating when our program panics. The mistake message that we get will also be stepped forward upon.
We will be able to take a look at color-eyre that may let us maintain the mistakes we obtain to be extra visible and human-readable.
The todo!(*5*) macro comes in handy and it additionally exposes what
occurs if our application panics.
(*10*) This might be each extra readable and include additional information (*10*) We're going to use cargo-edit (*10*) We have not proven off the whole lot that color_eyre is succesful We're going to see extra of ways this is helping as we construct out the CLI.thread 'primary' panicked at 'now not but carried out', src/primary.rs:2:5
be aware: run with `RUST_BACKTRACE=1` surroundings variable to show a backtrace(*5*)
whilst additionally being coloured the use of (*2*)color_eyre.The application panicked (crashed).
Message: now not but carried out
Location: src/primary.rs:5 Backtrace left out.
Run with RUST_BACKTRACE=1 surroundings variable to show it.
Run with RUST_BACKTRACE=complete to incorporate supply snippets.(*5*)
so as to add the bundle to our Shipment.toml.shipment set up cargo-edit
shipment upload color_eyre(*5*)primary(*5*) can go back
Consequence(*5*), so we will use
color_eyre(*5*)'s
Consequence(*5*) as our go back price and
color_eyre::set up(*5*) to
set up the default panic and mistake reporting hooks.
set up(*5*) returns a
Consequence(*5*) so we will be able to use
?(*5*) to maintain
any mistakes if vital.
of. Along with panic dealing with, color_eyre lets in us to
monitor additional info within the context of our mistakes
and come with tips through profiting from allotted
tracing infrastructure.