package fuseau

  1. Overview
  2. Docs

Source file exn_bt.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
open Common_

type t = {
  exn: exn;
  bt: Printexc.raw_backtrace;
}

let[@inline] make exn bt : t = { exn; bt }

let[@inline] get exn =
  let bt = Printexc.get_raw_backtrace () in
  { exn; bt }

let[@inline] get_callstack n exn =
  let bt = Printexc.get_callstack n in
  { bt; exn }

let show self = Printexc.to_string self.exn
let[@inline] raise self = Printexc.raise_with_backtrace self.exn self.bt

let[@inline] discontinue k self =
  ES.discontinue_with_backtrace k self.exn self.bt

let[@inline] discontinue_with k self h =
  ES.discontinue_with_backtrace k self.exn self.bt h

type nonrec 'a result = ('a, t) result