UNPKG

@visulima/cerebro

Version:

A delightful toolkit for building cross-runtime CLIs for Node.js, Deno, and Bun.

2 lines (1 loc) 826 B
var u=Object.defineProperty;var i=(e,r)=>u(e,"name",{value:r,configurable:!0});import{G as h}from"../packem_shared/renderError-ZMlMvw1N-eVUSdl6c.js";import{e as p}from"../packem_shared/runtime-process-G-n-wOub.js";var E=Object.defineProperty,a=i((e,r)=>E(e,"name",{value:r,configurable:!0}),"n");const P=a((e={})=>({description:"Enhanced error handling and reporting with beautiful code frames",name:"error-handler",onError:a(async(r,t)=>{const{logger:o,runtime:l}=t,{detailed:s=!1,exitOnError:d=!0,formatter:n,logErrors:f=!0,renderOptions:c={}}=e;if(f)if(n)o.error(n(r));else if(s){const g=l.getCwd(),m=h(r,{cwd:g,hideErrorCodeView:!1,hideErrorTitle:!1,hideMessage:!1,linesAbove:2,linesBelow:3,...c});o.error(m)}else o.error(r);d&&p(1)},"handleError"),version:"1.0.0"}),"errorHandlerPlugin");export{P as errorHandlerPlugin};