@asgard-js/core 0.3.25 → 0.3.26
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/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -0
- package/dist/index.mjs.map +1 -1
- package/dist/types/http-error.d.ts +8 -1
- package/dist/types/http-error.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
class w extends Error {
|
|
2
2
|
status;
|
|
3
3
|
statusText;
|
|
4
|
+
/**
|
|
5
|
+
* The decoded error payload, when the response carried one.
|
|
6
|
+
*
|
|
7
|
+
* Consumers branch on this — `asgard-ai-data-insight-web` reads `reason_code` off it to raise its
|
|
8
|
+
* credit-limit dialog on a `429` — so **always pass it when constructing from a real response**,
|
|
9
|
+
* even though the parameter is optional.
|
|
10
|
+
*/
|
|
4
11
|
body;
|
|
12
|
+
// `body` is optional because every construction site derives it from a response whose text or JSON
|
|
13
|
+
// may fail to parse, yielding `undefined` or `null`. An absent body is therefore a normal outcome
|
|
14
|
+
// rather than a caller mistake, and a test raising a status-only error need not pass a filler value.
|
|
5
15
|
constructor(t, e, r) {
|
|
6
16
|
super(`HTTP ${t}: ${e}`), this.name = "HttpError", this.status = t, this.statusText = e, this.body = r;
|
|
7
17
|
}
|