HttpException Handling in Custom Module?
Dear Forum Readers,
I handle (http)exceptions in the module the following way:
MyWebservice.Timeout = 300000 '5 minutes in milliseconds should be enough!
Dim I As Integer
For I = 0 To Symbols.Length - 1
Try
MySQString = MyWebservice.GetQuote(Symbols(I).Replace("csv", "AS"))
Catch
Me.Label3.Text = Localization.GetString("WebserviceExceptions", Me.LocalResourceFile)
Exit Sub
End Try
When the web service is very busy sometimes the request takes more than 5 minutes and consequently it times out and throws a httpException.
Setting:
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Then I get these ASP.NET unhandled exception pages:
Server Error in '/' Application.
Request timed out.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for
more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Request timed out.
Source Error:
Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can be
identified using the exception stack trace below.
[HttpException (0x80004005): Request timed out.]
Questions:
- Why is the exception not handled in my Try-Catch block?
- Must I specifically Catch ex As httpException
- The idea is that my Try-Catch block captures any kind of exception: http, soap etc!
- Why is setting <customErrors mode="Off"/> a security risk? Not that I need it since it does not prevent these ASP.NET unhandled exception pages and it also does not allow my Try-Catch to handle the exception.
- Is there a specific DotNetNuke Module exception handling I must apply?
Kind regards,
Johan van der Galiën.