@kenkaiiii/error-mom 0.3.4 → 0.3.5

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 CHANGED
@@ -104,7 +104,7 @@ Use `await errorMom.flush()` before a controlled shutdown. Call `dispose()` duri
104
104
 
105
105
  ## Automatic request capture
106
106
 
107
- Network failures and HTTP 5xx responses are captured automatically. Errors from known AI providers are named and tagged by provider; provider 4xx responses are captured as well.
107
+ Network failures and HTTP 5xx responses are captured automatically. Errors from known AI providers are named and tagged by provider; provider 4xx responses are captured as well. Captured request failures include sanitized method, URL, status, provider, and retryability context.
108
108
 
109
109
  ## Privacy and safety
110
110
 
@@ -3,7 +3,7 @@ import {
3
3
  redactStringCredentials
4
4
  } from "@kenkaiiii/error-mom-protocol";
5
5
  var SDK_NAME = "@kenkaiiii/error-mom";
6
- var SDK_VERSION = "0.3.4";
6
+ var SDK_VERSION = "0.3.5";
7
7
  var MAX_BREADCRUMBS = 50;
8
8
  var SECRET_KEY = /authorization|cookie|password|passwd|secret|token|api[-_]?key|session/i;
9
9
  function wrapFunction(capture, fn, context) {
@@ -156,6 +156,7 @@ function describeFailedRequest(method, url, status) {
156
156
  const relevant = status >= 500 || provider !== void 0 && status >= 400;
157
157
  if (!relevant) return void 0;
158
158
  const cleanUrl = redactString(url);
159
+ const retryable = status === 408 || status === 429 || status >= 500;
159
160
  const error = new Error(`${method} ${cleanUrl} returned ${status}`);
160
161
  if (provider) {
161
162
  const label = provider.charAt(0).toUpperCase() + provider.slice(1);
@@ -168,7 +169,11 @@ function describeFailedRequest(method, url, status) {
168
169
  tags: {
169
170
  statusCode: String(status),
170
171
  method,
172
+ retryable: String(retryable),
171
173
  ...provider ? { provider } : {}
174
+ },
175
+ context: {
176
+ request: { method, url: cleanUrl, status, retryable }
172
177
  }
173
178
  }
174
179
  };
package/dist/index.cjs CHANGED
@@ -27,7 +27,7 @@ module.exports = __toCommonJS(index_exports);
27
27
  // src/shared.ts
28
28
  var import_error_mom_protocol = require("@kenkaiiii/error-mom-protocol");
29
29
  var SDK_NAME = "@kenkaiiii/error-mom";
30
- var SDK_VERSION = "0.3.4";
30
+ var SDK_VERSION = "0.3.5";
31
31
  var MAX_BREADCRUMBS = 50;
32
32
  var SECRET_KEY = /authorization|cookie|password|passwd|secret|token|api[-_]?key|session/i;
33
33
  function wrapFunction(capture, fn, context) {
@@ -180,6 +180,7 @@ function describeFailedRequest(method, url, status) {
180
180
  const relevant = status >= 500 || provider !== void 0 && status >= 400;
181
181
  if (!relevant) return void 0;
182
182
  const cleanUrl = redactString(url);
183
+ const retryable = status === 408 || status === 429 || status >= 500;
183
184
  const error = new Error(`${method} ${cleanUrl} returned ${status}`);
184
185
  if (provider) {
185
186
  const label = provider.charAt(0).toUpperCase() + provider.slice(1);
@@ -192,7 +193,11 @@ function describeFailedRequest(method, url, status) {
192
193
  tags: {
193
194
  statusCode: String(status),
194
195
  method,
196
+ retryable: String(retryable),
195
197
  ...provider ? { provider } : {}
198
+ },
199
+ context: {
200
+ request: { method, url: cleanUrl, status, retryable }
196
201
  }
197
202
  }
198
203
  };
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  printable,
9
9
  redactString,
10
10
  wrapFunction
11
- } from "./chunk-ISLSQ4VJ.js";
11
+ } from "./chunk-OWVVPGEQ.js";
12
12
 
13
13
  // src/index.ts
14
14
  var clients = /* @__PURE__ */ new Map();
package/dist/node.cjs CHANGED
@@ -32,7 +32,7 @@ var import_node_path = require("path");
32
32
  // src/shared.ts
33
33
  var import_error_mom_protocol = require("@kenkaiiii/error-mom-protocol");
34
34
  var SDK_NAME = "@kenkaiiii/error-mom";
35
- var SDK_VERSION = "0.3.4";
35
+ var SDK_VERSION = "0.3.5";
36
36
  var MAX_BREADCRUMBS = 50;
37
37
  var SECRET_KEY = /authorization|cookie|password|passwd|secret|token|api[-_]?key|session/i;
38
38
  function wrapFunction(capture, fn, context) {
@@ -185,6 +185,7 @@ function describeFailedRequest(method, url, status) {
185
185
  const relevant = status >= 500 || provider !== void 0 && status >= 400;
186
186
  if (!relevant) return void 0;
187
187
  const cleanUrl = redactString(url);
188
+ const retryable = status === 408 || status === 429 || status >= 500;
188
189
  const error = new Error(`${method} ${cleanUrl} returned ${status}`);
189
190
  if (provider) {
190
191
  const label = provider.charAt(0).toUpperCase() + provider.slice(1);
@@ -197,7 +198,11 @@ function describeFailedRequest(method, url, status) {
197
198
  tags: {
198
199
  statusCode: String(status),
199
200
  method,
201
+ retryable: String(retryable),
200
202
  ...provider ? { provider } : {}
203
+ },
204
+ context: {
205
+ request: { method, url: cleanUrl, status, retryable }
201
206
  }
202
207
  }
203
208
  };
package/dist/node.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  printable,
9
9
  redactString,
10
10
  wrapFunction
11
- } from "./chunk-ISLSQ4VJ.js";
11
+ } from "./chunk-OWVVPGEQ.js";
12
12
 
13
13
  // src/node.ts
14
14
  import { createHash } from "crypto";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kenkaiiii/error-mom",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Automatic browser and Node.js error capture for self-hosted Error Mom",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -22,7 +22,7 @@
22
22
  "README.md"
23
23
  ],
24
24
  "dependencies": {
25
- "@kenkaiiii/error-mom-protocol": "0.1.2"
25
+ "@kenkaiiii/error-mom-protocol": "0.1.3"
26
26
  },
27
27
  "devDependencies": {
28
28
  "tsup": "^8.5.1",