package picos

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file picos_exn_bt.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
include Common

let get exn =
  let bt = Printexc.get_raw_backtrace () in
  { exn; bt }

let empty_backtrace = Printexc.get_callstack 0

let get_callstack n exn =
  let bt = if n <= 0 then empty_backtrace else Printexc.get_callstack n in
  { exn; bt }

let raise t = Printexc.raise_with_backtrace t.exn t.bt

(* *)

let discontinue k t = Effect.Deep.discontinue_with_backtrace k t.exn t.bt

let discontinue_with k t handler =
  Effect.Shallow.discontinue_with_backtrace k t.exn t.bt handler
OCaml

Innovation. Community. Security.