Skip to content

Commit

Permalink
Pass along custom properties added to Error (#1821)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben McCann <[email protected]>
  • Loading branch information
mohe2015 and benmccann authored Jul 8, 2021
1 parent 6335eff commit 872840a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-walls-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

Pass along custom properties added to Error
4 changes: 2 additions & 2 deletions packages/kit/src/runtime/server/page/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ function serialize_error(error) {
if (!error) return null;
let serialized = try_serialize(error);
if (!serialized) {
const { name, message, stack, frame, loc } = error;
serialized = try_serialize({ name, message, stack, frame, loc });
const { name, message, stack } = error;
serialized = try_serialize({ ...error, name, message, stack });
}
if (!serialized) {
serialized = '{}';
Expand Down

0 comments on commit 872840a

Please sign in to comment.