Error handling
When your program errors out
"Erroring out" means your program has encountered insurmountable difficulty and it will end. For instance, it could be out of memory, or the database is permanently down and connection cannot be re-established. These are errors that cannot be handled. If your program is started with
vf, it may be automatically restarted.
When report-error is called
You can report an error in your Vely code with
report-error, after which:
- if it is started with vf (such as a FastCGI application), the program will not exit, but rather it will skip the rest of the request and move on to handle the next request, or
- if it is a command_line application, it will exit.
When there is a problem in Vely
If there is a fatal internal error (i.e. error in Vely code itself that cannot be handled), it will be caught by Vely, and the program will end. If your program is started with
vf, it may be automatically restarted.
Logging the error
Regardless of the type of error and regardless of whether the program exits or not, the error is logged and the program stack with full source code lines (see
vv for including debug information) will be written to backtrace file (use -e option of
vv to obtain its location).
You can see the list of last N errors (and the location of file containing backtrace for them) by using
vv, for instance to see the last 3 errors:
See also
Error handling (
error_code error_handling on-error report-error )
SEE ALL (
documentation)