cyber-error
v0.0.4
Published
Intuitive error handling with native support for rethrows and custom flags along with an extendable dictionary of common errors
Downloads
36
Readme
Cyber/Error
Intuitive error handling with native support for rethrows and custom flags along with an extendable dictionary of common errors
Member of: CyberTools
Introduction
Custom error handling with native support for rethrows and specific flags affecting consequent behavior of the framework along with an extendable dictionary of common errors helps cover any scenarios, expected or unexpected.
Comes with an extendable dictionary of default errors for common use cases: Error Dictionary
Examples:
Robot.errors.Network
- throw, print and report a generic network errorRobot.errors.access.Blocked
- throw, print and report a generic access errorRobot.errors.session.Rotate
- rotate proxy session before retrying a failed actionRobot.errors.Status({error, retry: true, retireSession: true, statusCode: 403})
- rethrow previous error as cause of the custom error, retire proxy session before retrying failed action and print a message with failed status code before reporting the error to external monitoring channel