npm_package_json/error.rs
1use serde_json::Error as SerdeError;
2use std::io::Error as IoError;
3use thiserror::Error;
4
5/// The errors that this library can return.
6#[derive(Debug, Error)]
7pub enum Error {
8 /// An error that happened during IO operations.
9 #[error("io error")]
10 Io(#[from] IoError),
11 /// An error that happened during the parsing stage.
12 #[error("failed to parse package.json file")]
13 Parse(#[from] SerdeError),
14}