Alternative Error Handling

Joachim Niehren

provides
x-ozlib://niehren/error.ozf
x-ozlib://niehren/error/test.oz
requires
ssh (secure shell)

Purpose

Inspect your exception before it kills you: This packages defines an alternative error handling procedure that can be used instead of the usual: raise Exception end This solves the problem that one often wants to inspect an exception while also terminating the program execution (but not the inspection process).

This main procedure error.raise inspects an exception in an independent Oz process before raising it as usual. It type is value ->, i.e. it inputs an exception, inspects and raises it. An example is provided in the functor error/test.oz. declare Modules = ['x-ozlib://niehren/error.ozf'] declare [Error] = {Link Modules} declare Raise = Error.'raise' declare Exception = error(msg :gargel package:'your package' file :'your file' value :'your value') {Raise Exception} {Inspect 'this will never be browsed'}

Installation

Download the file niehren-error-0.3.pkg and invoke ozmake in a shell: ozmake --install --package=niehren-error-0.3.pkg


Joachim Niehren