Exception Handling

How the exception need to be handled if any error raised from mysql database? Any error handler is provided by library? Thanks