MY SQL Error handling

Hello All.

I have project whose back end is in My SQL.
I want to implement error handling in mysql.

It should work like below,

If any error occurred in regular store procedure, it should call error handling related store procedure and insert error in specific table.
This Sp call only if error occurs.
Please give sample error handling store procedure and regular search / insert store procedure which is calling error handling.

Thanks.