gulp-execa
Version:
Gulp.js command execution for humans
23 lines (14 loc) • 406 B
JavaScript
import PluginError from"plugin-error";
export const throwError=(error,opts)=>{
const errorA=error instanceof Error?error:new Error(error);
if(errorA.shortMessage!==undefined){
errorA.message=errorA.shortMessage;
delete errorA.shortMessage
}
throw new PluginError({...PLUGIN_ERROR_OPTS,...opts,error:errorA})
};
const PLUGIN_ERROR_OPTS={
plugin:"gulp-execa",
showProperties:false,
showStack:true
};