npm.io
0.1.10 • Published 5 years ago

@whi/serious-error-types

Licence
ISC
Version
0.1.10
Deps
0
Size
20 kB
Vulns
0
Weekly
0

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