@communecter/cocolight-api-client 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/error.js ADDED
@@ -0,0 +1,20 @@
1
+
2
+ export class ApiClientError extends Error {
3
+ constructor(message, status, details) {
4
+ super(message);
5
+ this.name = "ApiClientError";
6
+ this.status = status;
7
+ this.details = details;
8
+ }
9
+ }
10
+
11
+ /**
12
+ * CircuitBreakerError : levée lorsqu'on bloque l'accès à l'API (trop d'erreurs).
13
+ */
14
+ export class CircuitBreakerError extends Error {
15
+ constructor(message) {
16
+ super(message);
17
+ this.name = "CircuitBreakerError";
18
+ }
19
+ }
20
+