flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
25
VISUALIZACION/node_modules/parcel-bundler/lib/workerfarm/errorUtils.js
generated
vendored
Executable file
25
VISUALIZACION/node_modules/parcel-bundler/lib/workerfarm/errorUtils.js
generated
vendored
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
"use strict";
|
||||
|
||||
function errorToJson(error) {
|
||||
let jsonError = {
|
||||
message: error.message,
|
||||
stack: error.stack,
|
||||
name: error.name
|
||||
};
|
||||
// Add all custom codeFrame properties
|
||||
Object.keys(error).forEach(key => {
|
||||
jsonError[key] = error[key];
|
||||
});
|
||||
return jsonError;
|
||||
}
|
||||
|
||||
function jsonToError(json) {
|
||||
let error = new Error(json.message);
|
||||
Object.keys(json).forEach(key => {
|
||||
error[key] = json[key];
|
||||
});
|
||||
return error;
|
||||
}
|
||||
|
||||
exports.errorToJson = errorToJson;
|
||||
exports.jsonToError = jsonToError;
|
||||
Loading…
Add table
Add a link
Reference in a new issue