Skip to content

Exception backtraces are not preserved #69

@copy

Description

@copy

The following code:

open Popper
let () =
  Printexc.record_backtrace true;
  run (test (fun () ->
      failwith "XXX"
    ))

Prints:

0/1 tests passed and 1 failed in 0.00s:
  
  ✖  Anonymous  Failed  0ms  
  
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ Failed                                                                                 │
└────────────────────────────────────────────────────────────────────────────────────────┘

  Reason:
    
    Failure("XXX")
  
Test Failed: 0/1 tests passed and 1 failed in 0.00s.

Fatal error: exception Popper.Test_failure
Raised at Popper.run in file "src/lib/popper.ml", line 42, characters 4-22
Called from Dune__exe__Test in file "test.ml", line 4, characters 2-50

The backtrace is missing, making the debugging of exceptions (especially generic ones like Invalid_argument) quite difficult.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions