I think it is controller's responsibility to catch all exceptions. Models can catch exceptions but must throw it again to the controller,because models should not do control things . This is "single point of control". Controller catches exceptions and then to some controls. What do you say??
Originally posted by Nick Lee: Well,I think all the M V and C can catch exceptions,and they catch their own exceptions.
Hi Nick, When model catches the exception,there may be something happen to some models or views, if so, who will do this thing? I think modle should not do this thing. Of course model can catch exceptions and do not throws them again when there is nothing needed to change. What do you say?
Hi Biang I think it depends on what the exception is. There are some exceptions that you might want the model to try and recover from itself. To give an example: If you catch an exception stating that the network connection has died, you might choose to simply try and get a new network connection first, before bothering the client about it. Of course there are some exceptions that the model cannot recover from, and you might want to let the view handle it. Regards, Andrew