@vechain/sdk-errors
Version:
This module is dedicated to managing and customizing errors within the VeChain SDK
8 lines • 5.19 kB
JavaScript
var er=Object.defineProperty;var or=(t,a)=>{for(var o in a)er(t,o,{get:a[o],enumerable:true});};var rr={};or(rr,{CannotFindTransaction:()=>P,CertificateSignatureMismatch:()=>y,ContractCallError:()=>l,ContractDeploymentFailed:()=>D,HttpNetworkError:()=>k,InvalidAbiDataToEncodeOrDecode:()=>f,InvalidAbiItem:()=>i,InvalidAbiSignatureFormat:()=>g,InvalidAddress:()=>d,InvalidBloom:()=>E,InvalidBloomParams:()=>u,InvalidCommandLineArguments:()=>q,InvalidConfigurationFile:()=>B,InvalidConfigurationFilePath:()=>L,InvalidDataType:()=>b,InvalidHDKey:()=>h,InvalidHDKeyMnemonic:()=>O,InvalidHTTPParams:()=>V,InvalidHTTPRequest:()=>w,InvalidKeystore:()=>K,InvalidKeystoreParams:()=>S,InvalidOperation:()=>v,InvalidRLP:()=>T,InvalidSecp256k1MessageHash:()=>H,InvalidSecp256k1PrivateKey:()=>M,InvalidSecp256k1Signature:()=>J,InvalidTransactionField:()=>R,InvalidTransactionType:()=>I,JSONRPCInternalError:()=>X,JSONRPCInvalidDefaultBlock:()=>Y,JSONRPCInvalidParams:()=>Q,JSONRPCInvalidRequest:()=>W,JSONRPCMethodNotFound:()=>G,JSONRPCMethodNotImplemented:()=>_,JSONRPCParseError:()=>z,JSONRPCProviderError:()=>c,JSONRPCServerError:()=>Z,JSONRPCTransactionRevertError:()=>A,NotDelegatedTransaction:()=>C,PollExecution:()=>$,ProviderMethodError:()=>U,SignerMethodError:()=>F,UnavailableTransactionField:()=>N,UnsupportedOperation:()=>j,VechainSDKError:()=>r,assertInnerError:()=>x,createErrorMessage:()=>m,stringifyData:()=>p});var p=t=>JSON.stringify(t,(()=>{let o=new WeakSet;return (s,e)=>{if(typeof e=="object"&&e!==null&&s!==""){if(o.has(e))return;o.add(e);}return typeof e=="bigint"?e.toString()+"n":e}})(),2);function x(t){return t instanceof Error?t:new Error(`Inner error is not an instance of Error. Object:
${p(t)}`)}function m(t,a,o,s){let e=s?.message!==void 0?`
-Internal error:
${s.message}`:"";return `Method '${t}' failed.
-Reason: '${a}'
-Parameters:
${p(o)}`+e}var r=class extends Error{constructor(o,s,e,n){super(m(o,s,e,n===void 0?void 0:x(n)));this.methodName=o;this.errorMessage=s;this.data=e;this.innerError=n;}};var f=class extends r{},i=class extends r{},g=class extends r{};var d=class extends r{};var E=class extends r{},u=class extends r{};var y=class extends r{};var D=class extends r{},l=class extends r{};var b=class extends r{},j=class extends r{};var O=class extends r{},h=class extends r{};var w=class extends r{},V=class extends r{},k=class extends r{};var K=class extends r{},S=class extends r{};var $=class extends r{};var U=class extends r{},c=class extends r{constructor(o,s,e,n,tr){super(o,e,{code:s,message:e,data:n},tr);this.methodName=o;this.innerError=tr;}},z=class extends c{constructor(o,s,e,n){super(o,-32700,s,e,n);this.methodName=o;this.innerError=n;}},W=class extends c{constructor(o,s,e,n){super(o,-32600,s,e,n);this.methodName=o;this.innerError=n;}},G=class extends c{constructor(o,s,e,n){super(o,-32601,s,e,n);this.methodName=o;this.innerError=n;}},Q=class extends c{constructor(o,s,e,n){super(o,-32602,s,e,n);this.methodName=o;this.innerError=n;}},X=class extends c{constructor(o,s,e,n){super(o,-32603,s,e,n);this.methodName=o;this.innerError=n;}},Y=class extends r{},Z=class extends c{constructor(o,s,e,n){super(o,-32e3,s,e,n);this.methodName=o;this.innerError=n;}},_=class extends c{constructor(o,s,e,n){super(o,-32004,s,e,n);this.methodName=o;this.innerError=n;}},A=class extends Error{code;data;message;constructor(a,o){super(a||"execution reverted"),this.message=a,this.name="JSONRPCTransactionRevertError",this.code=-32e3,this.data=o,Object.setPrototypeOf(this,new.target.prototype);}};var T=class extends r{};var q=class extends r{},L=class extends r{},B=class extends r{};var M=class extends r{},H=class extends r{},J=class extends r{};var F=class extends r{};var N=class extends r{},R=class extends r{},C=class extends r{},P=class extends r{},I=class extends r{};var v=class extends r{};export{P as CannotFindTransaction,y as CertificateSignatureMismatch,l as ContractCallError,D as ContractDeploymentFailed,k as HttpNetworkError,f as InvalidAbiDataToEncodeOrDecode,i as InvalidAbiItem,g as InvalidAbiSignatureFormat,d as InvalidAddress,E as InvalidBloom,u as InvalidBloomParams,q as InvalidCommandLineArguments,B as InvalidConfigurationFile,L as InvalidConfigurationFilePath,b as InvalidDataType,h as InvalidHDKey,O as InvalidHDKeyMnemonic,V as InvalidHTTPParams,w as InvalidHTTPRequest,K as InvalidKeystore,S as InvalidKeystoreParams,v as InvalidOperation,T as InvalidRLP,H as InvalidSecp256k1MessageHash,M as InvalidSecp256k1PrivateKey,J as InvalidSecp256k1Signature,R as InvalidTransactionField,I as InvalidTransactionType,X as JSONRPCInternalError,Y as JSONRPCInvalidDefaultBlock,Q as JSONRPCInvalidParams,W as JSONRPCInvalidRequest,G as JSONRPCMethodNotFound,_ as JSONRPCMethodNotImplemented,z as JSONRPCParseError,c as JSONRPCProviderError,Z as JSONRPCServerError,A as JSONRPCTransactionRevertError,C as NotDelegatedTransaction,$ as PollExecution,U as ProviderMethodError,F as SignerMethodError,N as UnavailableTransactionField,j as UnsupportedOperation,r as VechainSDKError,x as assertInnerError,m as createErrorMessage,rr as errors,p as stringifyData};//# sourceMappingURL=index.mjs.map
//# sourceMappingURL=index.mjs.map