dotnet_parser/
lib.rs

1#![deny(unknown_lints)]
2#![deny(renamed_and_removed_lints)]
3#![forbid(unsafe_code)]
4#![deny(deprecated)]
5#![forbid(private_interfaces)]
6#![forbid(private_bounds)]
7#![forbid(non_fmt_panics)]
8#![deny(unreachable_code)]
9#![deny(unreachable_patterns)]
10#![forbid(unused_doc_comments)]
11#![forbid(unused_must_use)]
12#![deny(while_true)]
13#![deny(unused_parens)]
14#![deny(redundant_semicolons)]
15#![deny(non_ascii_idents)]
16#![deny(confusable_idents)]
17#![warn(missing_docs)]
18#![warn(clippy::missing_docs_in_private_items)]
19#![warn(clippy::cargo_common_metadata)]
20#![warn(rustdoc::missing_crate_level_docs)]
21#![deny(rustdoc::broken_intra_doc_links)]
22#![warn(missing_debug_implementations)]
23#![deny(clippy::mod_module_files)]
24#![doc = include_str!("../README.md")]
25
26pub mod outdated;
27
28use thiserror::Error;
29
30/// Error type for dotnet_parser
31#[derive(Debug, Error)]
32pub enum Error {
33    /// This means something went wrong when we were parsing the JSON output
34    /// of the program
35    #[error("Error parsing JSON: {0}")]
36    SerdeJsonError(#[from] serde_json::Error),
37    /// This is a wrapped serde_json error which provides a path to the location
38    /// where the error occurred
39    #[error("Error parsing JSON (with path): {0}")]
40    SerdePathError(#[from] serde_path_to_error::Error<serde_json::Error>),
41    /// This means the output of the program contained some string that was not
42    /// valid UTF-8
43    #[error("Error interpreting program output as UTF-8: {0}")]
44    Utf8Error(#[from] std::str::Utf8Error),
45    /// This is likely to be an error when executing the program using std::process
46    #[error("I/O Error: {0}")]
47    StdIoError(#[from] std::io::Error),
48    /// This means that we failed to convert a path into an Utf-8 string
49    #[error("Path conversion error")]
50    PathConversionError,
51}