use std::ffi::OsString;
use thiserror::Error;
use uucore::display::Quotable;
use uucore::error::{UError, strip_errno};
use uucore::translate;
#[derive(Debug, Error)]
pub enum TacError {
#[error("{}", translate!("tac-error-invalid-regex", "error" => .0))]
InvalidRegex(regex::Error),
#[error("{}", translate!("tac-error-open-error", "filename" => .0.quote(), "error" => strip_errno(.1)))]
OpenError(OsString, std::io::Error),
#[error("{}", translate!("tac-error-read-error", "filename" => .0.maybe_quote(), "error" => strip_errno(.1)))]
ReadError(OsString, std::io::Error),
#[error("{}", translate!("tac-error-write-error", "error" => strip_errno(.0)))]
WriteError(std::io::Error),
}
impl UError for TacError {
fn code(&self) -> i32 {
1
}
}