Skip to content

Commit

Permalink
Shorten code [refactor]
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Dec 18, 2023
1 parent 13a778b commit a3d99f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/serialize/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ function getErrorMessage(err) {

try {
const desc = Object.getOwnPropertyDescriptor(err, 'message');
return (desc && desc.value) || 'Unknown error';
return desc?.value || 'Unknown error';
} catch (e) {
return 'Unknown error';
}
Expand Down

0 comments on commit a3d99f3

Please sign in to comment.