UNPKG

@vechain/sdk-errors

Version:

This module is dedicated to managing and customizing errors within the VeChain SDK

8 lines 5.43 kB
'use strict';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{};exports.CannotFindTransaction=P;exports.CertificateSignatureMismatch=y;exports.ContractCallError=l;exports.ContractDeploymentFailed=D;exports.HttpNetworkError=k;exports.InvalidAbiDataToEncodeOrDecode=f;exports.InvalidAbiItem=i;exports.InvalidAbiSignatureFormat=g;exports.InvalidAddress=d;exports.InvalidBloom=E;exports.InvalidBloomParams=u;exports.InvalidCommandLineArguments=q;exports.InvalidConfigurationFile=B;exports.InvalidConfigurationFilePath=L;exports.InvalidDataType=b;exports.InvalidHDKey=h;exports.InvalidHDKeyMnemonic=O;exports.InvalidHTTPParams=V;exports.InvalidHTTPRequest=w;exports.InvalidKeystore=K;exports.InvalidKeystoreParams=S;exports.InvalidOperation=v;exports.InvalidRLP=T;exports.InvalidSecp256k1MessageHash=H;exports.InvalidSecp256k1PrivateKey=M;exports.InvalidSecp256k1Signature=J;exports.InvalidTransactionField=R;exports.InvalidTransactionType=I;exports.JSONRPCInternalError=X;exports.JSONRPCInvalidDefaultBlock=Y;exports.JSONRPCInvalidParams=Q;exports.JSONRPCInvalidRequest=W;exports.JSONRPCMethodNotFound=G;exports.JSONRPCMethodNotImplemented=_;exports.JSONRPCParseError=z;exports.JSONRPCProviderError=c;exports.JSONRPCServerError=Z;exports.JSONRPCTransactionRevertError=A;exports.NotDelegatedTransaction=C;exports.PollExecution=$;exports.ProviderMethodError=U;exports.SignerMethodError=F;exports.UnavailableTransactionField=N;exports.UnsupportedOperation=j;exports.VechainSDKError=r;exports.assertInnerError=x;exports.createErrorMessage=m;exports.errors=rr;exports.stringifyData=p;//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map