I have three layers:
My problem is the exception handling in the ServiceHandlers. I implemented my own exception could EntityNotFound
which i throw when the getEntity functions is called and doesnt find anything. What i do when i catch it is throw it again and catch it in Services.
Inside the catch block there i only use the statement throw; .. which i though would just throw it back again and then i was gonna catch in the catch statement in the winform layer. But what happens is that application stops in services layer and says "EntityNotFoundException" was unhandled which is okai but i want that to happen in the winform layer.
Hope this is understandable , so .. are there any suggestions ?
First off, Unless you are adding some value such as logging, or adding costume messages don't catch and rethrow exceptions. You can try ... catch the exception in the GUI layer to handle it there appropriately.
Second, a sample code would help to help you debugging the issue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.