fix(external-system-gateway): resolve ExternalSystemGateway-012,013,014 — failure logging, connection-limit wiring, test coverage; ExternalSystemGateway-011 flagged
This commit is contained in:
@@ -272,10 +272,21 @@ public class ExternalSystemClient : IExternalSystemClient
|
||||
|
||||
if (ErrorClassifier.IsTransient(response.StatusCode))
|
||||
{
|
||||
// Transient failures are normal operation (handled by retry / S&F) —
|
||||
// record at debug level only so the event log is not noisy.
|
||||
_logger.LogDebug(
|
||||
"Transient HTTP {StatusCode} from external system {System} calling {Method}.",
|
||||
(int)response.StatusCode, system.Name, method.Name);
|
||||
throw ErrorClassifier.AsTransient(
|
||||
$"HTTP {(int)response.StatusCode} from {system.Name}: {errorBody}");
|
||||
}
|
||||
|
||||
// The design requires permanent failures to be visible in Site Event
|
||||
// Logging — emit a warning so the gateway is not silent on a permanent
|
||||
// failure (ExternalSystemGateway-012).
|
||||
_logger.LogWarning(
|
||||
"Permanent HTTP {StatusCode} from external system {System} calling {Method}: {Error}",
|
||||
(int)response.StatusCode, system.Name, method.Name, errorBody);
|
||||
throw new PermanentExternalSystemException(
|
||||
$"HTTP {(int)response.StatusCode} from {system.Name}: {errorBody}",
|
||||
(int)response.StatusCode);
|
||||
|
||||
Reference in New Issue
Block a user