Registry / utility / thiserror

thiserror

JSON →
library2.0.18rscratesunverified

derive(Error) for easy custom error types.

# Cargo.toml [dependencies] thiserror = "2.0.18"
INSTALL
IMPORT
SIG · THISERROR
T
thiserror
utilityrustv2.0.18
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Error
✓ use thiserror::Error;

Defines a custom error enum with Display and Error trait implementations via derive.

use thiserror::Error; #[derive(Error, Debug)] pub enum MyError { #[error("network error: {0}")] Network(String), #[error("not found")] NotFound, } fn main() { let err = MyError::NotFound; println!("{}", err); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
2.0.18latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
thiserror — cargo add thiserror · libregistry