You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
316 B
JavaScript
11 lines
316 B
JavaScript
'use strict';
|
|
|
|
module.exports = function serializeError(error) {
|
|
/* The `name`, `message` and `stack` properties are not always enumerable, so we need to add them explicitly. */
|
|
return Object.assign({}, error, {
|
|
stack: error.stack,
|
|
message: error.message,
|
|
name: error.name
|
|
});
|
|
};
|