-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNfseErrorCode.php
More file actions
35 lines (26 loc) · 1.15 KB
/
NfseErrorCode.php
File metadata and controls
35 lines (26 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
// SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
// SPDX-License-Identifier: AGPL-3.0-or-later
declare(strict_types=1);
namespace LibreCodeCoop\NfsePHP\Exception;
/**
* Machine-readable error codes for NFS-e operations.
*
* These codes provide a deterministic, framework-agnostic way to identify
* the type of failure without relying on human-readable messages.
*/
enum NfseErrorCode: string
{
/** Connection to the SEFIN gateway could not be established. */
case NetworkFailure = 'NETWORK_FAILURE';
/** Gateway returned a response that could not be parsed. */
case InvalidResponse = 'INVALID_RESPONSE';
/** Gateway rejected the NFS-e issuance request (HTTP 4xx/5xx). */
case IssuanceRejected = 'ISSUANCE_REJECTED';
/** Gateway rejected the NFS-e cancellation request (HTTP 4xx/5xx). */
case CancellationRejected = 'CANCELLATION_REJECTED';
/** Gateway returned an error when querying an NFS-e (HTTP 4xx/5xx). */
case QueryFailed = 'QUERY_FAILED';
/** ADN gateway returned an error when retrieving DANFSE artifact (HTTP 4xx/5xx). */
case ArtifactRetrievalFailed = 'ARTIFACT_RETRIEVAL_FAILED';
}