shelving 1.150.2 → 1.150.3

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.
@@ -4,7 +4,7 @@ export class Feedbacks extends Feedback {
4
4
  /** List of named messages. */
5
5
  messages;
6
6
  constructor(messages) {
7
- super("Multiple errors");
7
+ super(Object.values(messages).join("\n"));
8
8
  this.messages = messages;
9
9
  }
10
10
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "state-management",
12
12
  "query-builder"
13
13
  ],
14
- "version": "1.150.2",
14
+ "version": "1.150.3",
15
15
  "repository": "https://github.com/dhoulb/shelving",
16
16
  "author": "Dave Houlbrooke <dave@shax.com>",
17
17
  "license": "0BSD",
package/util/http.js CHANGED
@@ -118,9 +118,9 @@ export function getErrorResponse(reason, debug = false) {
118
118
  const status = reason instanceof RequestError ? reason.code : 500;
119
119
  // Throw `Error` to return `{ message: "etc" }` to the client (but only if `debug` is true so we don't leak error details to the client).
120
120
  if (debug && isError(reason)) {
121
- // Manually destructure because `Error.prototype.message` is not enumerable.
122
- const { message, ...rest } = reason;
123
- return Response.json({ message, ...rest }, { status });
121
+ // Manually destructure because `message` and `cause` on `Error` are not enumerable.
122
+ const { message, cause, ...rest } = reason;
123
+ return Response.json({ message, cause, ...rest }, { status });
124
124
  }
125
125
  // Otherwise return a generic error message with no details.
126
126
  return new Response(undefined, { status });