jbdoderlein / BetterOCaml

A small but efficient, intuitive and responsive OCaml IDE right in your browser! Ships OCaml v5.1.1, interpreter by your browser (so it works offline!), compiled with js_of_ocaml.
https://perso.eleves.ens-rennes.fr/people/jean-baptiste.doderlein/betterocaml
Apache License 2.0
37 stars 8 forks source link

✨ output Toplevel runtime exception as Errors instead of standard output values #75

Closed AlexisHamon closed 5 months ago

AlexisHamon commented 5 months ago

In Ocaml top-level standard versions, runtime exceptions are treated as standard values. However, we can treat those values as exceptions for the user in order to see them with error formatting.

In this case, I colorize the runtime exceptions as errors, but we can easily switch behavior.

Example of code impacted :

exception Test;;

raise Test;;