[BLOG] OCaml Backtraces on Uncaught Exceptions, by OCamlPro

Depends on the program. I’d argue that it should be caught as late as possible.
If you have a daemon that handles many API calls then crashing the entire daemon because one API call triggered Invalid_argument is not desirable (might even be a DoS security bug). Instead the exception should be caught, logged, and prevented from interfering with the handling of other API calls.
The point to catch the exception is the main API call handler.

This is very different from Out_of_memory where you’ve exhausted a resource, and your exception handler may not have enough resources to succeed either (which is discussed in more detail in the linked discussion thread).

In fact to find the place to put the handler for these exceptions you can probably follow the rule of thumb in the linked thread, everything else should propagate the exceptions: