Common Script Error Code
CKB defines some basic error codes:
No. | Error code | Discription |
---|---|---|
1 | CKB_INDEX_OUT_OF_BOUND | All indices of the specified type have been fetched. |
2 | CKB_ITEM_MISSING | The requested entity is not present, such as fetching a Type Script from a cell that doesn’t have one. |
3 | CKB_LENGTH_NOT_ENOUGH | The data length is invalid, such as incorrect script arguments or signature length. |
4 | CKB_INVALID_DATA | Error in molecule serialization. |
5 | CKB_WAIT_FAILURE | The file descriptor is invalid during syscall Wait. |
6 | CKB_INVALID_FD | The file descriptor is not owned by this process. |
7 | CKB_OTHER_END_CLOSED | The other end of the pipe is closed. |
8 | CKB_MAX_VMS_SPAWNED | The maximum count of spawned processes has been reached. |
9 | CKB_MAX_FDS_CREATED | The maximum count of created pipes has been reached. |
In scenarios where read, write, or wait operations block each other, the system could enter a deadlock state. In such cases, CKB-VM will throw an internal error and terminate immediately.
Molecule Error Codes from CKB standard C library
#define MOL2_ERR_TOTAL_SIZE 0x01
#define MOL2_ERR_HEADER 0x02
#define MOL2_ERR_OFFSET 0x03
#define MOL2_ERR_UNKNOWN_ITEM 0x04
#define MOL2_ERR_INDEX_OUT_OF_BOUNDS 0x05
#define MOL2_ERR_FIELD_COUNT 0x06
#define MOL2_ERR_DATA 0x07
#define MOL2_ERR_OVERFLOW 0x08
Error codes from common scripts via ckb-script-error-codes