package.dist.apidom-error.browser.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apidom-error Show documentation
Show all versions of apidom-error Show documentation
Backward compatible custom ApiDOM errors with causes.
The newest version!
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apidomError=e():t.apidomError=e()}(self,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var s in r)t.o(r,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:r[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{ApiDOMAggregateError:()=>s,ApiDOMError:()=>c,ApiDOMStructuredError:()=>n,NotImplementedError:()=>i,UnsupportedOperationError:()=>a});class r extends AggregateError{constructor(t,e,r){if(super(t,e,r),this.name=this.constructor.name,"string"==typeof e&&(this.message=e),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(e).stack,null!=r&&"object"==typeof r&&Object.hasOwn(r,"cause")&&!("cause"in this)){const{cause:t}=r;this.cause=t,t instanceof Error&&"stack"in t&&(this.stack=`${this.stack}\nCAUSE: ${t.stack}`)}}}const s=r;class o extends Error{static[Symbol.hasInstance](t){return super[Symbol.hasInstance](t)||Function.prototype[Symbol.hasInstance].call(s,t)}constructor(t,e){if(super(t,e),this.name=this.constructor.name,"string"==typeof t&&(this.message=t),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack,null!=e&&"object"==typeof e&&Object.hasOwn(e,"cause")&&!("cause"in this)){const{cause:t}=e;this.cause=t,t instanceof Error&&"stack"in t&&(this.stack=`${this.stack}\nCAUSE: ${t.stack}`)}}}const c=o;const n=class extends c{constructor(t,e){if(super(t,e),null!=e&&"object"==typeof e){const{cause:t,...r}=e;Object.assign(this,r)}}};const a=class extends c{};const i=class extends a{};return e})()));