• Calls function f with the given arguments in protected mode. This means that any error inside f is not propagated; instead, pcall catches the error and returns a status code. Its first result is the status code (a boolean), which is true if the call succeeds without errors. In such case, pcall also returns all results from the call, after this first result. In case of any error, pcall returns false plus the error message.

    Type Parameters

    • This

    • Args extends any[]

    • R

    Parameters

    • f: ((this, ...args) => R)
        • (this, ...args): R
        • Parameters

          • this: This
          • Rest ...args: Args
            Rest

          Returns R

    • context: This
    • Rest ...args: Args
      Rest

    Returns LuaMultiReturn<[true, R] | [false, string]>

  • Type Parameters

    • A extends any[]

    • R

    Parameters

    • f: ((this, ...args) => R)
        • (this, ...args): R
        • Parameters

          • this: void
          • Rest ...args: A
            Rest

          Returns R

    • Rest ...args: A
      Rest

    Returns LuaMultiReturn<[true, R] | [false, string]>

Generated using TypeDoc