Skip to content

[TVM > Exit codes] Example for exit code 13 (-14) cannot catch the exit code, while it says it can #1462

Description

@novusnota

Two points here:

  1. It's not in Tolk yet, see: Replace Tact code snippets with Tolk #727
  2. try {
        repeat (pow(2, 31) - 1) { }
    } catch (exitCode) {
        // ← we won't get here, as execution will
        //   end in the try {} block due to lack of gas
    }

Mirror task in Tact docs: tact-lang/tact#3498. There, I've edited the code block to be like this:

try {
    // The exit code -14 can never be caught in try...catch,
    // and it is always thrown for the whole contract
    repeat (pow(2, 31) - 1) {}
} catch (_) {
    // This block will not be executed
}

Metadata

Metadata

Assignees

Labels

kind: bugSomething isn't working or doesn't seem rightscope: tvm/tvm folder: TON Virtual Machine

Type

No fields configured for Task.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions