fix(inbound): log swallowed scope-creation failure + test scope disposal on script throw
This commit is contained in:
@@ -251,9 +251,14 @@ public class InboundScriptExecutor
|
||||
{
|
||||
scope = _serviceProvider.CreateScope();
|
||||
}
|
||||
catch (InvalidOperationException)
|
||||
catch (InvalidOperationException ex)
|
||||
{
|
||||
// No scope factory available (provider does not support scoping).
|
||||
// No scope factory available (e.g. a non-scoping test-double provider).
|
||||
// In production this should never happen; log so a genuine container
|
||||
// misconfiguration is visible rather than silently disabling Database.
|
||||
_logger.LogWarning(ex,
|
||||
"Could not create a DI scope for method {Method}; Database will be unavailable to its script",
|
||||
method.Name);
|
||||
}
|
||||
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user