fix(InitializerProcessor): Add error logging to registerLazyService method
- Add error logging for lazy service registration failures - Log return_type, class, method, and full exception details - Helps diagnose why DatabasePlatform initializer registration fails silently
This commit is contained in:
@@ -186,7 +186,19 @@ final readonly class InitializerProcessor
|
|||||||
$this->container->singleton($returnType, $factory);
|
$this->container->singleton($returnType, $factory);
|
||||||
|
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
// Service registration failed - continue
|
// Safe Logger resolution - use if available
|
||||||
|
$logger = $this->container->has(Logger::class) ? $this->container->get(Logger::class) : null;
|
||||||
|
|
||||||
|
$logger?->error(
|
||||||
|
"Failed to register lazy service for return type: {$returnType}",
|
||||||
|
LogContext::withExceptionAndData($e, [
|
||||||
|
'return_type' => $returnType,
|
||||||
|
'class' => $className,
|
||||||
|
'method' => $methodName,
|
||||||
|
])
|
||||||
|
);
|
||||||
|
|
||||||
|
// Service registration failed - continue to prevent breaking the entire application
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user