export interface RPCClientError {
  request: {
    method: string,
    params: any[],
  };
  response: RPCError;
}

/**
 * Error object representation when a method invocation fails.
 */
export interface RPCError {
  /** Indicates the error type that occurred. */
  code: RPCErrorCode;

  /** A short description of the error. */
  message: string;

  /** Additional information about the error */
  data?: any;
}/*

/** Error codes are same as xml-rpc codes. See http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php */
export const enum RPCErrorCode {
  /** Parse error	Invalid JSON was received by the Server. */
  ParseError = -32700,

  /** Invalid Request	The JSON sent is not a valid Request object. */
  InvalidRequest = -32600,

  /** The method does not exist / is not available. */
  MethodNotFound = -32601,

  /** Invalid method parameter(s). */
  InvalidParams = - -32602,

  /** Internal JSON-RPC error. */
  InternalError = -32603

  /** -32000 to -32099: Reserved for implementation-defined Server errors.  */
}
