Error handling

By calling ECODE, DCODE, and PCODE, you can obtain additional information about SDK's own errors and errors from nodes for debugging.

ECODE

This is an error defined by imfact sdk, and mainly occurs when there is a problem with the function argument input value.

console.log(mitum.ECODE);
// output
{
    NO_API: "EC_NO_API",    
    UNKNOWN: "EC_UNKNOWN",
    EMPTY_STRING: "EC_EMPTY_STRING",
    EMPTY_SIGN: "EC_EMPTY_SIGN",
    INVALID_DATE: "EC_INVALID_DATE",
    INVALID_IP: "EC_INVALID_IP",
    INVALID_LENGTH: "EC_INVALID_LENGTH",
    INVALID_SEED: "EC_INVALID_SEED",
    INVALID_KEY: "EC_INVALID_KEY",
    INVALID_KEYS: "EC_INVALID_KEYS",
    ...
}

DCODE, PCODE:

This is an error that classifies the reason why the node “rejected” the transaction when “POST” a transaction to the blockchain and defines an additional explanation.

See all error code from herearrow-up-right.

Last updated