I want to create a custom exception, which is an exception for validating data in the controller of my CakePHP application. How to create my own custom exception handler in Cakephp so that I can throw an exception and throw an exception?
My sample code is:
function getUserDetails($userid){ try{ if(!$validUser){ throw new Exception('Invalid User'); } return $userDetailsData;
is it possible to use the special Exception class in cakephp here so that only this exception can be thrown, which I am doing. I hope he clarifies the question. thanks.
exception throw try-catch cakephp
shakil
source share