Exception handling means changing the usual expected flow of the code. This needs to be done to avoid errors. The exceptions in MySql can be handled using the following syntax:
DECLARE handler_type (Continue | Exit) HANDLER FOR condition_value[,...] sp_statement
Here, whenever an error occurs, the handler type value will decide whether to continue or Exit. Continue will execute the next Sql statement while exit will exit the procedure. Condition_value can take number of levels of categories. set condition is used to define code to be performed if the handler is called.