@nyc-transit-kit/soda3 0.1.0 → 0.1.2
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/package.json +3 -3
- package/src/errors.ts +7 -0
- package/src/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyc-transit-kit/soda3",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"test": "bun test ./test"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nyc-transit-kit/contracts": "0.1.
|
|
28
|
-
"effect": "4.0.0-beta.
|
|
27
|
+
"@nyc-transit-kit/contracts": "0.1.2",
|
|
28
|
+
"effect": "4.0.0-beta.92"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
package/src/errors.ts
CHANGED
|
@@ -47,5 +47,12 @@ export type Soda3ClientError =
|
|
|
47
47
|
| TimeoutError
|
|
48
48
|
| RetryExhaustedError
|
|
49
49
|
|
|
50
|
+
export const isSoda3ClientError = (value: unknown): value is Soda3ClientError =>
|
|
51
|
+
value instanceof InvalidInputError ||
|
|
52
|
+
value instanceof ProviderHttpError ||
|
|
53
|
+
value instanceof ProviderContractError ||
|
|
54
|
+
value instanceof TimeoutError ||
|
|
55
|
+
value instanceof RetryExhaustedError
|
|
56
|
+
|
|
50
57
|
export const isRetryableProviderError = (error: Soda3ClientError): error is ProviderHttpError =>
|
|
51
58
|
error._tag === "ProviderHttpError" && error.retryable
|