hedache
2011-04-29, 05:52 AM
When my page has an error that creates a 500-Internal Server Error, I want to see the usual non friendly error message such as
Microsoft VBScript compilation error '800a03ea'
Syntax error
/test.asp, line 3
If then
---^
First of all, let me mention that I have the Show friendly HTTP Errors unchecked in the browser. I can get the above message on a different domain that's not on the cloud account.
In the cloud account that I just signed up for, I have tried many options in the webspace\website configuration\error documents tab.
With the first two IIS Stadart options I get a generic message which is no use for me to debug any problem. I created a 500.asp page to handle errors and I tried two different pieces of code such as below.
Code 1:
Dim objErrorInfo
Set objErrorInfo = Server.GetLastError
ErrTxt = ErrTxt & "ASPCode = " & objErrorInfo.ASPCode & "<br>"
ErrTxt = ErrTxt & "ASPDescription = " & objErrorInfo.ASPDescription & "<br>"
ErrTxt = ErrTxt & "Category = " & objErrorInfo.Category & "<br>"
ErrTxt = ErrTxt & "Column = " & objErrorInfo.Column & "<br>"
ErrTxt = ErrTxt & "Description = " & objErrorInfo.Description & "<br>"
ErrTxt = ErrTxt & "File = " & objErrorInfo.File & "<br>"
ErrTxt = ErrTxt & "Line = " & objErrorInfo.Line & "<br>"
ErrTxt = ErrTxt & "Number = " & objErrorInfo.Number & "<br>"
ErrTxt = ErrTxt & "Source = " & objErrorInfo.Source & "<br>"
Response.Write ErrTxt
Code 2:
On Error Resume Next
Set objASPError = Server.GetLastError
Response.Write Server.HTMLEncode(objASPError.Category)
If Len(CStr(objASPError.ASPCode)) > 0 Then
Response.Write Server.HTMLEncode(", " & objASPError.ASPCode)
End If
Response.Write Server.HTMLEncode(" (0x" & Hex(objASPError.Number) & ")" ) & "<br>"
If Len(CStr(objASPError.ASPDescription)) > 0 Then
Response.Write Server.HTMLEncode(objASPError.ASPDescription) & "<br>"
ElseIf Len(CStr(objASPError.Description)) > 0 Then
Response.Write Server.HTMLEncode(objASPError.Description) & "<br>"
End If
Both of these return a blank section for what they should output. It seems like there is no error according to the code but there is. Do I have any options that I'm missing? Why isn't the ASP error object seem like it's not working?
Microsoft VBScript compilation error '800a03ea'
Syntax error
/test.asp, line 3
If then
---^
First of all, let me mention that I have the Show friendly HTTP Errors unchecked in the browser. I can get the above message on a different domain that's not on the cloud account.
In the cloud account that I just signed up for, I have tried many options in the webspace\website configuration\error documents tab.
With the first two IIS Stadart options I get a generic message which is no use for me to debug any problem. I created a 500.asp page to handle errors and I tried two different pieces of code such as below.
Code 1:
Dim objErrorInfo
Set objErrorInfo = Server.GetLastError
ErrTxt = ErrTxt & "ASPCode = " & objErrorInfo.ASPCode & "<br>"
ErrTxt = ErrTxt & "ASPDescription = " & objErrorInfo.ASPDescription & "<br>"
ErrTxt = ErrTxt & "Category = " & objErrorInfo.Category & "<br>"
ErrTxt = ErrTxt & "Column = " & objErrorInfo.Column & "<br>"
ErrTxt = ErrTxt & "Description = " & objErrorInfo.Description & "<br>"
ErrTxt = ErrTxt & "File = " & objErrorInfo.File & "<br>"
ErrTxt = ErrTxt & "Line = " & objErrorInfo.Line & "<br>"
ErrTxt = ErrTxt & "Number = " & objErrorInfo.Number & "<br>"
ErrTxt = ErrTxt & "Source = " & objErrorInfo.Source & "<br>"
Response.Write ErrTxt
Code 2:
On Error Resume Next
Set objASPError = Server.GetLastError
Response.Write Server.HTMLEncode(objASPError.Category)
If Len(CStr(objASPError.ASPCode)) > 0 Then
Response.Write Server.HTMLEncode(", " & objASPError.ASPCode)
End If
Response.Write Server.HTMLEncode(" (0x" & Hex(objASPError.Number) & ")" ) & "<br>"
If Len(CStr(objASPError.ASPDescription)) > 0 Then
Response.Write Server.HTMLEncode(objASPError.ASPDescription) & "<br>"
ElseIf Len(CStr(objASPError.Description)) > 0 Then
Response.Write Server.HTMLEncode(objASPError.Description) & "<br>"
End If
Both of these return a blank section for what they should output. It seems like there is no error according to the code but there is. Do I have any options that I'm missing? Why isn't the ASP error object seem like it's not working?