Hello,
If I have a controller which calls other classes for processing e.g. reading data from db and if I want to throw a custom exception for a particular function in one of the helper classes, then should I throw the exception in the helper class itself or in the controller class using setting up flags in helper classes?
If I throw the exceptions only in a single class, then its easy to maintain whereas if I use helper class, no need to setup flags for each and every case.
What about "Throw early catch late" principle here.
Please advise.
If I have a controller which calls other classes for processing e.g. reading data from db and if I want to throw a custom exception for a particular function in one of the helper classes, then should I throw the exception in the helper class itself or in the controller class using setting up flags in helper classes?
If I throw the exceptions only in a single class, then its easy to maintain whereas if I use helper class, no need to setup flags for each and every case.
What about "Throw early catch late" principle here.
Please advise.