No instruction limit hit canister logs within timer

One of our automated tests for Azle started to hang after an update to our JavaScript interpreter bindings. I believe I have tracked the problem down to an instruction limit being hit within a timer…our tests expected some kind of error to be thrown, but the timer of course doesn’t throw any errors that a request/response would have returned in the response.

The concerning part is that when I ask for the canister logs locally I don’t see any indication of the instruction limit being hit…I am just intuiting that it was hit based on some trial and error of our test (which has everything to do with the instruction limit).

Do the canister logs not show things like the instruction limit being hit?

1 Like

No this is not automatically happening. Traps will appear in canister logs, the instruction limit being hit is an error that you would need to handle. With the on_error canister hook, you could also have this appear in the canister logs (or do any other type of handling you want). We can also consider adding it to the logs as it’s a special type of error that’s probably interesting for most developers.

2 Likes

Do you have a link to more info on the on_error canister hook? I don’t see this in the Rust CDK or in the interface spec.

I feel like it should be added, it’s a major and common error to run into at least for Azle canisters.

1 Like

It’s not implemented yet, I meant “when it’s available, it can be an option to log through that”.