mte/unikernel/duniverse/ppxlib/test/location/exception/test.ml

18 lines
413 B
OCaml
Raw Normal View History

2025-11-11 02:07:51 +01:00
open Ppxlib.Location
let catch_as_compiler_exception =
try raise_errorf ~loc:none "foo" with
| Ocaml_common.Location.Error _ -> "caught"
| _ -> "uncaught"
[%%expect{|
val catch_as_compiler_exception : string = "caught"
|}]
let catch_as_ppxlib_exception =
try raise_errorf ~loc:none "foo" with
| Error _ -> "caught"
| _ -> "uncaught"
[%%expect{|
val catch_as_ppxlib_exception : string = "caught"
|}]