/serious-error-types

Well defined error types designed for creating robust and deterministic code.

Primary LanguageJavaScript

Serious Error Types

This module brings a hierarchy of well defined error types to help make error handling a proactive measure rather than a reactive obligation.

Overview

The ethos behind the hierarchy of types is set of failure mode strategies for creating robust and deterministic code.

The "Serious" in this module's name implies that these error types are for developers who take their code seriously; it should not imply that the errors are critical, dangerous, or severe.

Error Hierarchy

Error
 |
 |- EvalError
 |- InternalError
 |- RangeError
 |- ReferenceError
 |- SyntaxError
 |- TypeError
 |- URIError
 |
 '- SeriousError
     |
     |- InputError
     |   |- MissingArgumentError
     |   '- InvalidArgumentError
     |
     |- DatabaseError
     |   |- DatabaseQueryError
     |   '- ItemNotFoundError
     |
     |- AuthError
     |   |- AuthenticationError
     |   '- AuthorizationError
     |
     '- HTTPError
         |- HTTPRequestError
         |   '- NotFoundError
         |   '- MethodNotAllowedError
         '- HTTPResponseError