pcre-ocaml
pcre-ocaml copied to clipboard
Function for printing Pcre exceptions?
I didn't find a function that takes a Pcre.Error
exception and prints a human-friendly representation. By default, we're getting Pcre.Error(5)
instead of Pcre.Error(RecursionLimit)
. The plan would be that the user would call Printexc.register_printer Pcre.string_of_exn
, or maybe just Pcre.register_exception_printer ()
.
I'll make a PR if you think that's a good idea.
Here's an implementation: https://github.com/returntocorp/semgrep/blob/15f082ccedcd4d2c07493e23bc15e72d2cf330f8/semgrep-core/src/core/Pcre_settings.ml#L20-L50