Difference between revisions of "Error Handling inside Internet Computer"
Line 26: | Line 26: | ||
A canister can be installed in a two step process. In the first step, a canister is created in a subnet and alloted a canister id. At this point, the canister is empty and does not contain any code. In the second step, the controller of the canister can install a Wasm module in the canister. If anyone sends an update/query call to the canister before the wasm module is installed, then CanisterWasmModuleNotFound error is thrown. | A canister can be installed in a two step process. In the first step, a canister is created in a subnet and alloted a canister id. At this point, the canister is empty and does not contain any code. In the second step, the controller of the canister can install a Wasm module in the canister. If anyone sends an update/query call to the canister before the wasm module is installed, then CanisterWasmModuleNotFound error is thrown. | ||
− | ===== | + | ===== InsufficientTransferFunds: StatusCode 401 ===== |
+ | |||
+ | ===== InsufficientMemoryAllocation: StatusCode 402 ===== | ||
+ | |||
+ | ===== InsufficientCyclesForCreateCanister: StatusCode 403 ===== | ||
+ | |||
+ | ===== SubnetNotFound: StatusCode 404 ===== |
Revision as of 21:17, 24 October 2022
This Page is Still Work in Progress
SubnetOverSubscribed: StatusCode 101
This error is raised when installing a new canister or increasing memory allocation in the canister, and no compute allocation or memory capacity is left in the subnet.
MaxNumberOfCanistersReached: StatusCode 102
There is an option in the NNS registry to set a max limit on the number of canisters in a subnet. When a new canister is created, the subnet checks if this maximum limit is reached and throws an error accordingly. Currently, we don’t limit the number of canisters in a subnet.
CanisterOutputQueueFull: StatusCode 201
Internet Computer allows one canister to call another canister. These outgoing inter-canister canister calls are placed in the output queues of the canister. There is a currently a limit of 500 messages per output queue. CanisterOutputQueueFull error is thrown when this limit is reached.
IngressMessageTimeout: StatusCode 202
A user can call a method of a canister by sending an ingress message. The ingress messages go through consensus protocol. The ingress messages that are accepted by the consensus layer are pushed into ingress queue of the corresponding canister. The canister processes the messages in its ingress queue in order. If the system is quite loaded and if a message stays in the ingress queue for over 5 minutes, then IngressMessageTimeout error is thrown.
CanisterNotFound: StatusCode 301
When a user/canister calls a canister which is not found, CanisterNotFound error is thrown.
CanisterMethodNotFound: StatusCode 302
Each canister exposes a few methods that can be invoked by anyone. When a user/canister calls another canister, they need to specify a method to be invoked in the target canister. If this method is not found in the target canister, CanisterMethodNotFound error is thrown.
CanisterAlreadyInstalled: StatusCode 303
When anyone attempts to create a new canister, they can optionally specify a canister id that is to be used for the newly created canister. If the specified canister id is already taken (another canister exists with the specified canister id), then CanisterAlreadyInstalled error is thrown.
CanisterWasmModuleNotFound: StatusCode 304
A canister can be installed in a two step process. In the first step, a canister is created in a subnet and alloted a canister id. At this point, the canister is empty and does not contain any code. In the second step, the controller of the canister can install a Wasm module in the canister. If anyone sends an update/query call to the canister before the wasm module is installed, then CanisterWasmModuleNotFound error is thrown.