NEP18 Exception Information - ghewgill/neon-lang GitHub Wiki

This proposal changes the way information is passed when raising exceptions.

Current Situation

Currently, exceptions may contain optional information in the form of an ExceptionInfo record:

RAISE ExampleException(info WITH "description", code WITH number)

The info field must be a string, and the code field must be a number.

Proposal

The current scheme is limited in the kind of information that can be passed around when raising an exception. It would be possible to encode more information into the string, for example using a JSON encoding, but this is awkward.

This proposal replaces the two fields with a single info field of type Object, which can hold any Neon object including an array or a dictionary. This allows more information to be passed around when raising exceptions, in a language-supported type-safe way.