UNPKG

@lgd-utils/error

Version:
2 lines (1 loc) 468 B
import r from"lodash/forOwn";import t from"lodash/set";class s extends Error{constructor(r){super(r),this.name=this.constructor.name,"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(r).stack}}class o extends s{constructor(s,o){super(s),this.isCustomError=!0,r(o,((r,s)=>{t(this,s,r)}))}}o.isCustomError=!0;var c={CustomError:o,ExtendableError:s};export{o as CustomError,s as ExtendableError,c as default};