This commit is contained in:
JiriUhlir
2026-06-18 11:05:46 +02:00
parent f44ffae9fc
commit 09db30a3ca
84 changed files with 3952 additions and 15 deletions
+26
View File
@@ -0,0 +1,26 @@
using System.Net;
namespace Csob.Client;
/// <summary>
/// Raised when the ČSOB PSD2 API returns a non-success HTTP status. Carries the upstream status
/// and the raw error body so the middleware can surface it without leaking credentials.
/// </summary>
public sealed class CsobApiException : Exception
{
public HttpStatusCode StatusCode { get; }
/// <summary>Machine-readable error codes parsed from the ČSOB <c>errors[].error</c> array (best effort).</summary>
public IReadOnlyList<string> ErrorCodes { get; }
/// <summary>Raw response body (already credential-free — it is the upstream's own error payload).</summary>
public string? RawBody { get; }
public CsobApiException(HttpStatusCode statusCode, IReadOnlyList<string> errorCodes, string? rawBody)
: base($"ČSOB PSD2 API returned {(int)statusCode} ({statusCode}).")
{
StatusCode = statusCode;
ErrorCodes = errorCodes;
RawBody = rawBody;
}
}