@databallr/sdk 0.3.0 → 0.3.1
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/README.md +8 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,9 +37,14 @@ const standings = await dbr.get("/v1/nba/standings", { query: { season: 2026 } }
|
|
|
37
37
|
`code` is UPPER_SNAKE for errors any call can hit: `INVALID_TOKEN` (401),
|
|
38
38
|
`INSUFFICIENT_SCOPE` (403), `RATE_LIMITED` (429), `UPSTREAM_ERROR` (502),
|
|
39
39
|
or `HTTP_ERROR` when the body is not the API's error envelope. An
|
|
40
|
-
operation's own errors (bad input, nothing found)
|
|
41
|
-
|
|
42
|
-
`
|
|
40
|
+
operation's own errors (bad input, nothing found) carry one code per
|
|
41
|
+
status: `INVALID_REQUEST` (400), `UNAUTHORIZED` (401), `FORBIDDEN` (403),
|
|
42
|
+
`NOT_FOUND` (404), `METHOD_NOT_ALLOWED` (405), `CONFLICT` (409),
|
|
43
|
+
`BODY_TOO_LARGE` (413), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500),
|
|
44
|
+
`UPSTREAM_ERROR` (502), `SERVICE_UNAVAILABLE` (503). The reason
|
|
45
|
+
(`"Valid user_id is required"`) is the error's `message`; it is written
|
|
46
|
+
for people and can change, so branch on `code`. The API does not send
|
|
47
|
+
`type` yet, so it is
|
|
43
48
|
`undefined` and `retryable` is `false`; the client's own retries do not
|
|
44
49
|
depend on them. Network failures throw
|
|
45
50
|
`DataballrConnectionError`, and timeouts its subclass
|