mirror of
https://github.com/denisidoro/navi.git
synced 2026-07-23 18:18:06 +00:00
Add wrapper error telling the user to file an issue
This commit is contained in:
parent
a625b0aea0
commit
4bc9b00a52
4 changed files with 24 additions and 3 deletions
19
src/structures/error/file_issue.rs
Normal file
19
src/structures/error/file_issue.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
use std::fmt::Debug;
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
#[error(
|
||||
"Hey listen! Navi encountered a problem.
|
||||
|
||||
Do you think this is a bug? File an issue at https://github.com/denisidoro/navi."
|
||||
)]
|
||||
pub struct FileAnIssue(#[source] anyhow::Error);
|
||||
|
||||
impl FileAnIssue {
|
||||
pub fn new<SourceError>(source: SourceError) -> Self
|
||||
where
|
||||
SourceError: Into<anyhow::Error>,
|
||||
{
|
||||
FileAnIssue(source.into())
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +1,3 @@
|
|||
pub mod command;
|
||||
pub mod file_issue;
|
||||
pub mod filesystem;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue