use std::{path::PathBuf, string::FromUtf8Error};
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error("I/O error while {0}:\n{1}")]
Io(&'static str, std::io::Error),
#[error("I/O error at path {0:?} while {1}:\n{2}")]
IoPath(PathBuf, &'static str, std::io::Error),
#[error(transparent)]
InvalidUTF8(#[from] FromUtf8Error),
#[error("No input file given.")]
NoInputFile,
#[error("Error while unpacking gzip file:\n{0}")]
InvalidGzip(std::io::Error),
#[error("File parsing error:\n{0}")]
ParseError(String),
#[error("Error while interpreting file in line {0}:\nAffected line:\n{1}\n\nReason:\n{2}")]
InterpreterError(usize, String, String),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("Unsupported schema version: {0}")]
UnsupportedSchemaVersion(String),
}