File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ // SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
4+ // SPDX-License-Identifier: AGPL-3.0-or-later
5+
6+ declare (strict_types=1 );
7+
8+ namespace LibreCodeCoop \NfsePHP \Exception ;
9+
10+ /**
11+ * Thrown when the SEFIN gateway responds with an HTTP error status (4xx/5xx).
12+ *
13+ * The upstream error payload is preserved to allow callers to surface
14+ * gateway-specific diagnostic information (e.g. fiscal rejection codes).
15+ */
16+ class GatewayException extends NfseException
17+ {
18+ /**
19+ * @param array<string, mixed> $upstreamPayload Raw decoded response body from the gateway.
20+ */
21+ public function __construct (
22+ string $ message ,
23+ public readonly NfseErrorCode $ errorCode ,
24+ public readonly int $ httpStatus = 0 ,
25+ public readonly array $ upstreamPayload = [],
26+ ?\Throwable $ previous = null ,
27+ ) {
28+ parent ::__construct ($ message , 0 , $ previous );
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments