Sometimes you want to wrap error objects with application-specific errors for your stack traces.
Your custom error constructor:
function CustomError(e, extra) {
Error.call(this);
Error.captureStackTrace(this, CustomError);
this.id = e.id;
this.name = 'CustomError';