diff --git a/app/Services/DecisionEvents/Registry.php b/app/Services/DecisionEvents/Registry.php index cbd0d94..0dbf14a 100644 --- a/app/Services/DecisionEvents/Registry.php +++ b/app/Services/DecisionEvents/Registry.php @@ -24,9 +24,12 @@ public static function resolve(string $key): DecisionEventHandler { $key = trim(strtolower($key)); $class = static::$map[$key] ?? null; - if (! $class || ! class_exists($class)) { + if (! $class) { throw new InvalidArgumentException("Unknown decision event handler for key: {$key}"); } + if (! class_exists($class)) { + throw new InvalidArgumentException("Handler class {$class} for key {$key} does not exist (check autoload)"); + } $handler = app($class); if (! $handler instanceof DecisionEventHandler) { throw new InvalidArgumentException("Handler for key {$key} must implement DecisionEventHandler");