aboutsummaryrefslogtreecommitdiff
path: root/src/errors
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-09-03 11:49:49 +0200
committerHampusM <hampus@hampusmat.com>2022-09-03 11:49:49 +0200
commitea0309436b55d72f57478ed6f74bf31d000f5366 (patch)
treef8dfade30d9aac7e982cdd957dc609f337889598 /src/errors
parent40109b5298160795cedca4c8204c8a1dd0bcd0be (diff)
refactor: improve DI container cast errors
Diffstat (limited to 'src/errors')
-rw-r--r--src/errors/di_container.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/errors/di_container.rs b/src/errors/di_container.rs
index 82a3d55..5e53f43 100644
--- a/src/errors/di_container.rs
+++ b/src/errors/di_container.rs
@@ -11,8 +11,17 @@ use crate::errors::injectable::InjectableError;
pub enum DIContainerError
{
/// Unable to cast a binding for a interface.
- #[error("Unable to cast binding for interface '{0}'")]
- CastFailed(&'static str),
+ #[error(
+ "Unable to cast binding for interface '{interface} with kind '{binding_kind}'"
+ )]
+ CastFailed
+ {
+ /// The interface.
+ interface: &'static str,
+
+ /// The kind of the found binding.
+ binding_kind: &'static str,
+ },
/// Failed to resolve a binding for a interface.
#[error("Failed to resolve binding for interface '{interface}'")]