Skip to content

Commit c51cc5d

Browse files
authored
refactor: jsonErrorReplacer to use explicit Error type (#125)
1 parent a00e3a4 commit c51cc5d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/handler.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -880,10 +880,11 @@ function jsonErrorReplacer(
880880
// GraphQL errors implement their own stringer
881881
!isGraphQLError(val)
882882
) {
883+
const error = val as Error;
883884
return {
884-
// name: val.name, name is included in message
885-
message: val.message,
886-
// stack: val.stack, can leak sensitive details
885+
// name: error.name, name is included in message
886+
message: error.message,
887+
// stack: error.stack, can leak sensitive details
887888
};
888889
}
889890
return val;

0 commit comments

Comments
 (0)