hono-problem-details 0.3.0 → 0.4.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/README.md +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -380,7 +380,7 @@ problemDetailsHandler({
|
|
|
380
380
|
// Default type URI (default: "about:blank")
|
|
381
381
|
defaultType: "about:blank",
|
|
382
382
|
|
|
383
|
-
// Include stack trace in
|
|
383
|
+
// Include stack trace in `extensions.stack` on 500 responses (development only)
|
|
384
384
|
includeStack: process.env.NODE_ENV === "development",
|
|
385
385
|
|
|
386
386
|
// Populate `instance` from `c.req.path` when the thrown problem didn't specify one
|
package/dist/index.cjs
CHANGED
|
@@ -211,7 +211,8 @@ function problemDetailsHandler(options = {}) {
|
|
|
211
211
|
status: 500,
|
|
212
212
|
type: buildType(500, options),
|
|
213
213
|
title: "Internal Server Error",
|
|
214
|
-
detail:
|
|
214
|
+
detail: "An unexpected error occurred",
|
|
215
|
+
extensions: options.includeStack ? { stack: error.stack } : void 0
|
|
215
216
|
},
|
|
216
217
|
c,
|
|
217
218
|
options
|
package/dist/index.d.cts
CHANGED
|
@@ -38,7 +38,12 @@ interface ProblemDetailsHandlerOptions {
|
|
|
38
38
|
typePrefix?: string;
|
|
39
39
|
/** Default type URI. Defaults to "about:blank" */
|
|
40
40
|
defaultType?: string;
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Include the stack trace on unhandled `Error` responses (500). The stack is
|
|
43
|
+
* emitted as a top-level `stack` extension member per RFC 9457 §3.1 flattening,
|
|
44
|
+
* not in `detail`, to prevent leakage into UIs that render `detail` verbatim.
|
|
45
|
+
* Development-only.
|
|
46
|
+
*/
|
|
42
47
|
includeStack?: boolean;
|
|
43
48
|
/**
|
|
44
49
|
* When `true`, populate `instance` from the request path (`c.req.path`) if
|
package/dist/index.d.ts
CHANGED
|
@@ -38,7 +38,12 @@ interface ProblemDetailsHandlerOptions {
|
|
|
38
38
|
typePrefix?: string;
|
|
39
39
|
/** Default type URI. Defaults to "about:blank" */
|
|
40
40
|
defaultType?: string;
|
|
41
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Include the stack trace on unhandled `Error` responses (500). The stack is
|
|
43
|
+
* emitted as a top-level `stack` extension member per RFC 9457 §3.1 flattening,
|
|
44
|
+
* not in `detail`, to prevent leakage into UIs that render `detail` verbatim.
|
|
45
|
+
* Development-only.
|
|
46
|
+
*/
|
|
42
47
|
includeStack?: boolean;
|
|
43
48
|
/**
|
|
44
49
|
* When `true`, populate `instance` from the request path (`c.req.path`) if
|
package/dist/index.js
CHANGED
|
@@ -84,7 +84,8 @@ function problemDetailsHandler(options = {}) {
|
|
|
84
84
|
status: 500,
|
|
85
85
|
type: buildType(500, options),
|
|
86
86
|
title: "Internal Server Error",
|
|
87
|
-
detail:
|
|
87
|
+
detail: "An unexpected error occurred",
|
|
88
|
+
extensions: options.includeStack ? { stack: error.stack } : void 0
|
|
88
89
|
},
|
|
89
90
|
c,
|
|
90
91
|
options
|