ErrorResponse

interface ErrorResponse {
    // example
    // status: 400,
    // method: 'post',
    // url: 'http://127.0.0.1:24321/builder/send',
    // error_code: 'P01D101',
    // request_body: '{"_hint":"mitum-currency-transfer-operation-v0.0.1","fact":{....}}'
    // error_message: 'handle new operation invalid signing :  check threshold unknown key found, 26vyVJFoLZqVPmP8UADoNCsEyJYD4498vdy7uoiHgFKRUmpu'
    status?: number;
    method: string | undefined;
    url: string | undefined;
    error_code: string;
    request_body: string | undefined;
    error_message: string;
}
  • status: The HTTP response status code indicating an error. For example, it could be 400 for a Bad Request.

  • method: The HTTP method used for the request. For instance, it could be GET, POST, PUT, etc.

  • url: The URL address to which the request was sent. This represents the destination of the request.

  • error_code: An string combined with pcode and dcode. pcode and dcode are error codes associated with the error response from the blockchain network. pcode provides information about at what stage the error occurred, and dcode provides information about the reason for the error. In case of get method, error_code is given as an empty string.

  • request_body: The data included in the body of the HTTP request. This contains any data sent along with the request. If the request method is GET, the request body will be undefined.

  • error_message: A human-readable error message providing details about the error encountered. This message can help in diagnosing and troubleshooting issues.

Example

// import Mitum Object first, see import Mitum section

const mitum = new Mitum("http://127.0.0.1:24321");
const contractAddress = "0xE8213471913c9dA4F4CcAB3Cc32Ec5a75d96d9cafca";

const nftsInfo = async () =>{
    const info = await mitum.nft.getNFTs(contractAddress);
    console.log(info);
}
nftsInfo();

//ErrorResponse
{
  status: 400,
  method: 'get',
  url: 'http://127.0.0.1:24321/nft/0xE8213471913c9dA4F4CcAB3Cc32Ec5a75d96d9cafca/nfts',
  error_code: "",
  request_body: undefined,
  error_message: 'not found - nft tokens by contract, 0xE8213471913c9dA4F4CcAB3Cc32Ec5a75d96d9cafca'
}

Last updated