Error Handling - Try Catch Exception

Hi, in my application when some data deleted or not available in the database, the page displaying the PHP notice error or PHP Fatal error and PHP warning errors. I don’t want to display the notice or fatal errors. instant of the php error, want to throw the Exception error. Please any one help me how to the same.?

Is this happening on the development machine? Try turning off DEBUG in the bootstrap file. It might also be a setting in the php.ini for error reporting.

Yes you can put delete statement under try block and in catch block you can throw your own custom exception,with

throw new CHttpException(‘errpr-code’,‘error-message’);