asp.net - Exception handling in Class Library for WinForms and Asp -


I am writing a class library with a professional library which is a new Winforms project and an existing ASP.NET project.

During the development, with the library

 try  as the exception, whatever message gets caught, the exception message box ("Friendly error message", ex.message) Try end  / pre> 

which will work fine for winforms, but will not work for asp.net I need a friendly (and easy) way to trap exceptions which work for both platforms Or better question maybe I would like to have exceptions in the class library. Can I implore?

or better question maybe I might be the trapping exceptions in the class library?

No class libraries should do nothing with exceptions. Why do you get an error, tell the real reason for this reason, for the developer it is very difficult to understand what was wrong. .

It does not matter whether the developer is you or someone else because when you come back to the code for a year, then you have no clue what actually happened (unless the original exception remains intact Do not be).

In order to deal with the exception, I have 100% opposed / everywhere in the application. There is really no benefit to use the Application.ThreadException event to display the message box to the user in WinForms. Overrides the error event for logging exceptions in ASP.NET and displaying a friendly error page.

I have also created a service that takes care of everything for you. This is a free version that you can use.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -