pavex/blueprint/error_handler.rs
1use pavex_bp_schema::Blueprint as BlueprintSchema;
2
3use super::reflection::AnnotationCoordinates;
4
5/// The input type for [`Blueprint::error_handler`].
6///
7/// Check out [`Blueprint::error_handler`] for more information on error handling
8/// in Pavex.
9///
10/// # Stability guarantees
11///
12/// Use the [`error_handler`](macro@crate::error_handler) attribute macro to create instances of `ErrorHandler`.\
13/// `ErrorHandler`'s fields are an implementation detail of Pavex's macros and should not be relied upon:
14/// newer versions of Pavex may add, remove or modify its fields.
15///
16/// [`Blueprint::error_handler`]: crate::Blueprint::error_handler
17pub struct ErrorHandler {
18 #[doc(hidden)]
19 pub coordinates: AnnotationCoordinates,
20}
21
22/// The type returned by [`Blueprint::error_handler`].
23///
24/// # Future-proofing
25///
26/// As of today, [`RegisteredErrorHandler`] doesn't provide any additional functionality.\
27/// It is included to allow introducing new configuration for error handlers without having
28/// to change the signature of [`Blueprint::error_handler`].
29///
30/// [`Blueprint::error_handler`]: crate::Blueprint::error_handler
31pub struct RegisteredErrorHandler<'a> {
32 #[allow(dead_code)]
33 pub(crate) blueprint: &'a mut BlueprintSchema,
34}