TYPE

try_call_result

type try_call_result<T>

Type representing the result of a function call that may have thrown a require exception.

Constructed by calling try_call_catch(). Contains either a value of type T or error information.

Use is_error to check if the call failed, value to get the value (if the call succeeded), value_or_null to get the value or null (if the call failed), or require_message_or_null to get the error message (if the call failed) or null (if the call succeeded).

Since

0.14.16

Attributes
  • is_error: boolean

    Check if this result represents an error.

    Since

    0.14.16

  • value: T

    Get the value contained in this result.

    Throws

    • exception — if the function call threw a require exception

    Since

    0.14.16

  • value_or_null: T?

    Get the value contained in this result or null if this result represents an error.

    Since

    0.14.16

  • require_message_or_null: text?

    Get the error message from the require exception that was thrown by the function call, or null if the function call did not throw an exception.

    Since

    0.14.16

© 2026 Chromia