Closed mjambon closed 1 year ago
I tried reproducing this locally, but wasn't able to see that behavior. Could you give a more specific set-up / export and share the switch you are using with me to reproduce?
This is with base.v0.14.3 (the result of some version constraints on some of our dependencies I don't know how to tell which package is holding us back actually we should be able to use base.v0.15.1 according to the actions required by opam install base.v0.15.1
). I see it's fixed in base.v0.16.0 and base.v0.15.1. Sorry for the noise.
Problem
The Base library registers printers for exceptions from the standard library, including the
Failure
exception raised byfailwith
, without our consent. We don't want that. We need to control how we print exceptions. We don't use Base directly but it's an indirect dependency of our application.How to reproduce
🙄
Similarly, if we happen to register our own exception printer too early, it gets clobbered by Base:
Desired behavior
Loading Base or any library that depends on it should not change how standard library exceptions are printed. Let application authors control how they print non-Base exceptions by having them run
Base.Application.init ()
explicitly. More generally, don't alter the behavior of other libraries unless explicitly requested by the application author.Current workaround
Failure
and such.init ()
function at the last moment to ensure that we register our exception printers after Base.