How to Use the thiserror Crate for Custom Errors

Use the `thiserror` crate to define custom error enums with automatic `std::error::Error` implementation via derive macros.

Add thiserror to your dependencies and derive the Error trait on your enum to automatically implement std::error::Error.

[dependencies]
thiserror = "1.0.60"
use thiserror::Error;

#[derive(Debug, Error)]
pub enum Error {
    #[error("No config for '{0}'")]
    NoConfig(String),

    #[error(transparent)]
    Mdbook(#[from] mdbook_preprocessor::errors::Error),
}