Good point. Setting err.message and then throw(err);-ing again instead of creating a new Error object should be no problem. Result would be something like:
try {
//method call
} catch (err) {
if (err.name === "Error" /* && maybe another check, need to check the source for that */) {
err.message = "Security methods already installed"; //or something similar
}
throw(err);
}
Good point. Setting err.message and then throw(err);-ing again instead of creating a new Error object should be no problem. Result would be something like:
try {
//method call
} catch (err) {
if (err.name === "Error" /* && maybe another check, need to check the source for that */) {
err.message = "Security methods already installed"; //or something similar
}
throw(err);
}
Is that ok with you considering the above?