Exceptions
Created by: VLanvin
Exceptions have been completely removed and replaced by result types, except in a few places. This allows for safer code and better documentation at the cost of a small syntactic overhead (which mostly occurs in initialization and rendering functions).
Examples are unfortunately not self-contained anymore and slightly more verbose since they open a module that provides result type handlers and operators. We need to decide whether we should privilege self-containment vs readability and conciseness.
The remaining exceptions are located in:
-
objLexer.mll, which might raise SyntaxError, but this exception is hidden and caught in model.ml.
-
The implementation of OgamlCore.LL.Window for Windows, which might raise Failure. However, this exception is hidden and caught by OgamlGraphics.Window.
-
The exceptions present in OgamlAudio have not been removed since this module is still a WIP. These will be dealt with in another branch.