-
Notifications
You must be signed in to change notification settings - Fork 0
Error management in command's action
Vincent Peybernes edited this page Jul 26, 2013
·
3 revisions
Command.IO provide a custom error management system, to protect the application execution from end user error.
Command.IO provide two custom error type: CommandError and RuntimeCommandError. This errors inherit of the JavaScript Error object with two additionnal properties: the command name what throw the error and the severity levelof the error.
The error are provided by the command controler (this in action function).
All errors throwed in command action are analysed by Command.IO.
- If a RuntimeCommandError are catch it throwed on runtime and stop the execution.
- If is a CommandError and if his severity level is under the catching level, the error are only logged. Else it throwed on runtime.
Only CommandError are catch for now.
The catching level can be configured in the command descriptor with the èxceptionCatchLvl`property. View command descriptor