views:

26

answers:

1

Hi,

In a winforms application where the UI code calls business methods in my business classes, is it best practice to pass errors back to the UI code as an exception?

Also if there are say a couple of main types of exceptions that a particular business method may have, where would it make sense to tailor the text that gets presented to the user for these in the UI?

thanks

+2  A: 

Exceptions should be handled at the level they are best dealt with. In most cases this is your user interface; however there are a number of reasons for handling exceptions in your code.

In regards to the user experience of exception messages you'll find an excellent article here on displaying exception/error messages in your WinForms/WPF applications.

Kane