fix(inbound): log swallowed scope-creation failure + test scope disposal on script throw

This commit is contained in:
Joseph Doherty
2026-06-16 21:51:33 -04:00
parent daff1446d8
commit d4ec84d5fb
2 changed files with 52 additions and 2 deletions
@@ -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