QuickBEAM.JSError exception (QuickBEAM v0.11.0)

View Source

Represents an uncaught JavaScript exception at a QuickBEAM API boundary.

Errors include stable JavaScript source locations and structured JavaScript frames without exposing Elixir handler stack traces.

Summary

Functions

Converts a JavaScript error value returned by the native runtime.

Builds an exception from an uncaught VM value and JavaScript stack frames.

Converts a VM-generated exception reason into a catchable JavaScript value.

Types

frame()

@type frame() :: %{
  function: String.t(),
  filename: String.t() | nil,
  line: pos_integer() | nil,
  column: pos_integer() | nil
}

t()

@type t() :: %QuickBEAM.JSError{
  __exception__: term(),
  column: pos_integer() | nil,
  filename: String.t() | nil,
  frames: [frame()],
  line: pos_integer() | nil,
  message: String.t(),
  name: String.t(),
  stack: String.t() | nil
}

Functions

from_js_value(value)

Converts a JavaScript error value returned by the native runtime.

from_vm(reason, frames)

@spec from_vm(term(), [frame()]) :: t()

Builds an exception from an uncaught VM value and JavaScript stack frames.

vm_exception_value(reason)

Converts a VM-generated exception reason into a catchable JavaScript value.