Tech/LxEngine/Errors and Messages

Error Handling
In non-performance critical code, errors should be handled as exceptions. Return values should be reserved for behavior when the function is executed within it's defined domain.


 * lx0::error_exception should be used for errors that, while unexpected, as possibly recoverable.
 * lx0::fatal_exception should be used for errors that indicate the application should shutdown as soon as possible to avoid data corruption or loss. These exceptions should not be caught, unless to save critical data and then be rethrown.

Individual parts of the code may choose to sub-class error_exception to allow specific types of errors to be caught by different handlers.

The common error handling code should:
 * Catch the error_exception
 * Call error_exception::detail to add details about where this error is occuring
 * Clean-up any local state to deal with the error
 * Re-throw unless the error can be handled completely and with certainty. When in doubt rethrow!