Handle SQL uncaught error