@vechain/sdk-errors
Version:
This module is dedicated to managing and customizing errors within the VeChain SDK
57 lines (54 loc) • 5.06 kB
JavaScript
'use strict';
var v=Object.defineProperty;var rr=(t,a)=>{for(var o in a)v(t,o,{get:a[o],enumerable:!0});};var P={};rr(P,{CannotFindTransaction:()=>F,CertificateSignatureMismatch:()=>y,ContractCallError:()=>b,ContractDeploymentFailed:()=>u,InvalidAbiDataToEncodeOrDecode:()=>f,InvalidAbiItem:()=>i,InvalidAbiSignatureFormat:()=>E,InvalidAddress:()=>g,InvalidBloom:()=>d,InvalidBloomParams:()=>D,InvalidCommandLineArguments:()=>Z,InvalidConfigurationFile:()=>A,InvalidConfigurationFilePath:()=>_,InvalidDataType:()=>j,InvalidHDKey:()=>w,InvalidHDKeyMnemonic:()=>O,InvalidHTTPRequest:()=>h,InvalidKeystore:()=>V,InvalidKeystoreParams:()=>k,InvalidOperation:()=>C,InvalidRLP:()=>Y,InvalidSecp256k1MessageHash:()=>H,InvalidSecp256k1PrivateKey:()=>q,InvalidSecp256k1Signature:()=>L,InvalidTransactionField:()=>J,InvalidTransactionType:()=>R,JSONRPCInternalError:()=>G,JSONRPCInvalidDefaultBlock:()=>Q,JSONRPCInvalidParams:()=>W,JSONRPCInvalidRequest:()=>U,JSONRPCMethodNotFound:()=>z,JSONRPCMethodNotImplemented:()=>X,JSONRPCParseError:()=>$,JSONRPCProviderError:()=>c,JSONRPCServerError:()=>T,NotDelegatedTransaction:()=>N,PollExecution:()=>K,ProviderMethodError:()=>S,SignerMethodError:()=>B,UnavailableTransactionField:()=>M,UnsupportedOperation:()=>l,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{},E=class extends r{};var g=class extends r{};var d=class extends r{},D=class extends r{};var y=class extends r{};var u=class extends r{},b=class extends r{};var j=class extends r{},l=class extends r{};var O=class extends r{},w=class extends r{};var h=class extends r{};var V=class extends r{},k=class extends r{};var K=class extends r{};var S=class extends r{},c=class extends r{constructor(o,s,e,n,I){super(o,e,{code:s,message:e,data:n},I);this.methodName=o;this.innerError=I;}},$=class extends c{constructor(o,s,e,n){super(o,-32700,s,e,n);this.methodName=o;this.innerError=n;}},U=class extends c{constructor(o,s,e,n){super(o,-32600,s,e,n);this.methodName=o;this.innerError=n;}},z=class extends c{constructor(o,s,e,n){super(o,-32601,s,e,n);this.methodName=o;this.innerError=n;}},W=class extends c{constructor(o,s,e,n){super(o,-32602,s,e,n);this.methodName=o;this.innerError=n;}},G=class extends c{constructor(o,s,e,n){super(o,-32603,s,e,n);this.methodName=o;this.innerError=n;}},Q=class extends r{},T=class extends c{constructor(o,s,e,n){super(o,-32e3,s,e,n);this.methodName=o;this.innerError=n;}},X=class extends c{constructor(o,s,e,n){super(o,-32004,s,e,n);this.methodName=o;this.innerError=n;}};var Y=class extends r{};var Z=class extends r{},_=class extends r{},A=class extends r{};var q=class extends r{},H=class extends r{},L=class extends r{};var B=class extends r{};var M=class extends r{},J=class extends r{},N=class extends r{},F=class extends r{},R=class extends r{};var C=class extends r{};
exports.CannotFindTransaction = F;
exports.CertificateSignatureMismatch = y;
exports.ContractCallError = b;
exports.ContractDeploymentFailed = u;
exports.InvalidAbiDataToEncodeOrDecode = f;
exports.InvalidAbiItem = i;
exports.InvalidAbiSignatureFormat = E;
exports.InvalidAddress = g;
exports.InvalidBloom = d;
exports.InvalidBloomParams = D;
exports.InvalidCommandLineArguments = Z;
exports.InvalidConfigurationFile = A;
exports.InvalidConfigurationFilePath = _;
exports.InvalidDataType = j;
exports.InvalidHDKey = w;
exports.InvalidHDKeyMnemonic = O;
exports.InvalidHTTPRequest = h;
exports.InvalidKeystore = V;
exports.InvalidKeystoreParams = k;
exports.InvalidOperation = C;
exports.InvalidRLP = Y;
exports.InvalidSecp256k1MessageHash = H;
exports.InvalidSecp256k1PrivateKey = q;
exports.InvalidSecp256k1Signature = L;
exports.InvalidTransactionField = J;
exports.InvalidTransactionType = R;
exports.JSONRPCInternalError = G;
exports.JSONRPCInvalidDefaultBlock = Q;
exports.JSONRPCInvalidParams = W;
exports.JSONRPCInvalidRequest = U;
exports.JSONRPCMethodNotFound = z;
exports.JSONRPCMethodNotImplemented = X;
exports.JSONRPCParseError = $;
exports.JSONRPCProviderError = c;
exports.JSONRPCServerError = T;
exports.NotDelegatedTransaction = N;
exports.PollExecution = K;
exports.ProviderMethodError = S;
exports.SignerMethodError = B;
exports.UnavailableTransactionField = M;
exports.UnsupportedOperation = l;
exports.VechainSDKError = r;
exports.assertInnerError = x;
exports.createErrorMessage = m;
exports.errors = P;
exports.stringifyData = p;