···3939 (* The daemon was cancelled because all non-daemon fibers are finished. *)
4040 ()
4141 | exception ex ->
4242- Switch.fail sw ex; (* The [with_daemon] ensures this will succeed *)
4242+ let bt = Printexc.get_raw_backtrace () in
4343+ Switch.fail ~bt sw ex; (* The [with_daemon] ensures this will succeed *)
4344 ) (* else the fiber should report the error to [sw], but [sw] is failed anyway *)
44454546let fork_promise ~sw f =
···6566 match Switch.with_op sw f with
6667 | x -> Promise.resolve r x
6768 | exception ex ->
6868- Switch.fail sw ex (* The [with_op] ensures this will succeed *)
6969+ let bt = Printexc.get_raw_backtrace () in
7070+ Switch.fail ~bt sw ex (* The [with_op] ensures this will succeed *)
6971 );
7072 p
7173