aboutsummaryrefslogtreecommitdiff
path: root/src/errors
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-01-31 21:44:05 +0100
committerHampusM <hampus@hampusmat.com>2023-01-31 21:44:05 +0100
commit118651055b7844e04aa5b89023c385e483de305f (patch)
tree7386bf48a10732d9cadc7d19ed3d05fc0efd7b93 /src/errors
parente8a2475b2f07da14c45a429b2b52e75322d0efb5 (diff)
fix: remove unwrap from generated implementations of Injectable
Diffstat (limited to 'src/errors')
-rw-r--r--src/errors/injectable.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/errors/injectable.rs b/src/errors/injectable.rs
index f132063..f040062 100644
--- a/src/errors/injectable.rs
+++ b/src/errors/injectable.rs
@@ -4,6 +4,7 @@
use crate::dependency_history::DependencyHistory;
use crate::errors::di_container::DIContainerError;
+use crate::errors::ptr::SomePtrError;
/// Error type for structs that implement [`Injectable`].
///
@@ -42,4 +43,16 @@ pub enum InjectableError
/// History of dependencies.
dependency_history: DependencyHistory,
},
+
+ /// Failed to prepare a dependency.
+ #[error("Failed to prepare dependency '{dependency_name}'")]
+ PrepareDependencyFailed
+ {
+ /// Error reason.
+ #[source]
+ reason: SomePtrError,
+
+ /// The name of the dependency.
+ dependency_name: &'static str,
+ },
}