Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

never ever panic ;-) #160

Closed
przygienda opened this issue Feb 23, 2018 · 1 comment
Closed

never ever panic ;-) #160

przygienda opened this issue Feb 23, 2018 · 1 comment

Comments

@przygienda
Copy link

so, I'm not sure it's a panic in any of the packages but I got

$<2>Feb 22 ...$<2> thread '' panicked at 'slog::Fuse Drain: Custom { kind: Other, error: StringError("term error: color not supported by the terminal") }', /home/prz/.cargo/registry/src/github.com-1ecc6299db9ec823/slog-2.1.1/src/lib.rs:1695:33

which is not good. I want an error back so I can e.g. back off to no color drain in my application ...

we'd need an API that returns the error ...

@dpc
Copy link
Collaborator

dpc commented Feb 23, 2018

Well, the meaning of .fuse()/Fuse is to panic on errors. You can write your own error handling/ignore errors.

The slog-term has returned an error: https://github.com/slog-rs/term/blob/master/src/lib.rs#L1359 and Fuse panicked.

Also, I think in newer slog-term version, I've implemented a fallback. So if the terminal is not available for whatever reason (typically docker), stdio will be used: slog-rs/term@93587a3 . Make sure you're using the newest version. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants