stacktrace

Types

位置

pub type Location {
  Location(file: option.Option(String), line: option.Option(Int))
}

Constructors

参数数量/列表

pub type Params {
  Arity(Int)
  Args(List(dynamic.Dynamic))
}

Constructors

栈帧

pub type StackFrame {
  StackFrame(
    module: String,
    function: String,
    params: Params,
    location: Location,
  )
}

Constructors

  • StackFrame(
      module: String,
      function: String,
      params: Params,
      location: Location,
    )

    module: 模块

    func: 函数

    arity: 参数数量/列表

    location: 位置

栈帧列表

pub type StackFrameList =
  List(StackFrame)

Values

pub fn from_exception(
  ex: error.Exception,
) -> Result(List(StackFrame), Nil)

从Exception获取StackFrameList

由于类型是公开的,你完全可以伪造一个Stacktrace

✨ Search Document