Debugging Apex
Apex provides debugging support. You can debug your Apex code using the Developer Console and debug logs.
To aid debugging in your code, Apex supports exception statements and custom exceptions. Also, Apex sends emails to developers for unhandled exceptions.
-
Exceptions note errors and other events that disrupt the normal flow of code execution.
throwstatements are used to generate exceptions, whiletry,catch, andfinallystatements are used to gracefully recover from exceptions.