mirror of
https://github.com/eyre-rs/eyre.git
synced 2025-10-02 07:21:36 +00:00
make new release (#46)
* change panic example to be consistent with usage example * bump versions for new release
This commit is contained in:
parent
544ef9feba
commit
7316c8ff94
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "color-eyre"
|
name = "color-eyre"
|
||||||
version = "0.5.0"
|
version = "0.5.1"
|
||||||
authors = ["Jane Lusby <jlusby@yaah.dev>"]
|
authors = ["Jane Lusby <jlusby@yaah.dev>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
@ -20,7 +20,7 @@ eyre = "0.6.0"
|
|||||||
tracing-error = { version = "0.1.2", optional = true }
|
tracing-error = { version = "0.1.2", optional = true }
|
||||||
backtrace = { version = "0.3.48", features = ["gimli-symbolize"] }
|
backtrace = { version = "0.3.48", features = ["gimli-symbolize"] }
|
||||||
indenter = "0.3.0"
|
indenter = "0.3.0"
|
||||||
ansi_term = "0.11"
|
ansi_term = "0.12"
|
||||||
color-spantrace = { version = "0.1.4", optional = true }
|
color-spantrace = { version = "0.1.4", optional = true }
|
||||||
once_cell = "1.4.0"
|
once_cell = "1.4.0"
|
||||||
|
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
use tracing::instrument;
|
use color_eyre::{eyre::Report, eyre::WrapErr, Section};
|
||||||
|
use tracing::{info, instrument};
|
||||||
|
|
||||||
#[instrument]
|
#[instrument]
|
||||||
fn main() {
|
fn main() -> Result<(), Report> {
|
||||||
#[cfg(feature = "capture-spantrace")]
|
#[cfg(feature = "capture-spantrace")]
|
||||||
install_tracing();
|
install_tracing();
|
||||||
color_eyre::install().unwrap();
|
|
||||||
|
|
||||||
do_thing(42);
|
color_eyre::install()?;
|
||||||
}
|
|
||||||
|
|
||||||
#[instrument]
|
read_config();
|
||||||
fn do_thing(thing: u32) {
|
|
||||||
panic!("some real basic stuff went wrong")
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "capture-spantrace")]
|
#[cfg(feature = "capture-spantrace")]
|
||||||
@ -31,3 +30,15 @@ fn install_tracing() {
|
|||||||
.with(ErrorLayer::default())
|
.with(ErrorLayer::default())
|
||||||
.init();
|
.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[instrument]
|
||||||
|
fn read_file(path: &str) {
|
||||||
|
if let Err(e) = std::fs::read_to_string(path) {
|
||||||
|
panic!("{}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[instrument]
|
||||||
|
fn read_config() {
|
||||||
|
read_file("fake_file")
|
||||||
|
}
|
||||||
|
@ -334,7 +334,7 @@
|
|||||||
//! [`examples/custom_filter.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/custom_filter.rs
|
//! [`examples/custom_filter.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/custom_filter.rs
|
||||||
//! [`examples/custom_section.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/custom_section.rs
|
//! [`examples/custom_section.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/custom_section.rs
|
||||||
//! [`examples/multiple_errors.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/multiple_errors.rs
|
//! [`examples/multiple_errors.rs`]: https://github.com/yaahc/color-eyre/blob/master/examples/multiple_errors.rs
|
||||||
#![doc(html_root_url = "https://docs.rs/color-eyre/0.5.0")]
|
#![doc(html_root_url = "https://docs.rs/color-eyre/0.5.1")]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
#![warn(
|
#![warn(
|
||||||
missing_docs,
|
missing_docs,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user