ignore all io errors while resolving source files (#12)

* ignore all io errors while resolving source files

* prep for release
This commit is contained in:
Jane Lusby 2020-12-02 11:12:34 -08:00 committed by GitHub
commit f7e61e648f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 6 deletions

View File

@ -7,8 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
<!-- next-header -->
## [Unreleased] - ReleaseDate
## [0.1.6] - 2020-12-02
### Fixed
- Ignore all io errors when resolving source files instead of only file not
found errors
## [v0.1.5] - 2020-12-01
### Added
- Support custom color themes for spantrace format
<!-- next-url -->
[Unreleased]: https://github.com/yaahc/color-spantrace/releases/tag/v0.1.5
[Unreleased]: https://github.com/yaahc/color-spantrace/compare/v0.1.6...HEAD
[0.1.6]: https://github.com/yaahc/color-spantrace/compare/v0.1.5...v0.1.6
[v0.1.5]: https://github.com/yaahc/color-spantrace/releases/tag/v0.1.5

View File

@ -1,6 +1,6 @@
[package]
name = "color-spantrace"
version = "0.1.6-alpha.0"
version = "0.1.6"
authors = ["Jane Lusby <jlusby@yaah.dev>"]
edition = "2018"
license = "MIT OR Apache-2.0"
@ -26,6 +26,9 @@ ansi-parser = "0.6.5" # used for testing color schemes
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
[package.metadata.release]
no-dev-version = true
[[package.metadata.release.pre-release-replacements]]
file = "CHANGELOG.md"
search = "Unreleased"

View File

@ -59,7 +59,7 @@
//!
//! [`tracing_error::SpanTrace`]: https://docs.rs/tracing-error/*/tracing_error/struct.SpanTrace.html
//! [`color-backtrace`]: https://github.com/athre0z/color-backtrace
#![doc(html_root_url = "https://docs.rs/color-spantrace/0.1.4")]
#![doc(html_root_url = "https://docs.rs/color-spantrace/0.1.6")]
#![warn(
missing_debug_implementations,
missing_docs,
@ -88,7 +88,7 @@ use owo_colors::{style, Style};
use std::env;
use std::fmt;
use std::fs::File;
use std::io::{BufRead, BufReader, ErrorKind};
use std::io::{BufRead, BufReader};
use tracing_error::SpanTrace;
static THEME: OnceCell<Theme> = OnceCell::new();
@ -315,8 +315,8 @@ impl Frame<'_> {
let file = match File::open(filename) {
Ok(file) => file,
Err(ref e) if e.kind() == ErrorKind::NotFound => return Ok(()),
e @ Err(_) => e.unwrap(),
// ignore io errors and just don't print the source
Err(_) => return Ok(()),
};
use std::fmt::Write;

View File

@ -40,6 +40,7 @@ use tracing_error::SpanTrace;
use tracing_subscriber::{prelude::*, registry::Registry};
#[instrument]
#[allow(clippy::clippy::if_same_then_else)]
fn test_capture(x: u8) -> SpanTrace {
if x == 42 {
SpanTrace::capture()