I know lots of questions have been asked about this before, but this one seems to be slightly different to all the others.
When I write some poor ASP code such as:
Dim a = 7
I will get a detailed error message telling me I'm an idiot. However, if a make a runtime error such as
a = 0/0
The page will immediately finish. The loaded page shows only what was written before the error and (most importantly) there is no error message hinting at where/what the error was
How can I get runtime error messages?
What I have tried so far:
I've tried putting this into the web.config as per this question
<configuration>
<system.webServer>
<httpErrors errorMode="Detailed" />
</system.webServer>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
However that made no difference.
I also tried what was suggested in this answer:
If you can't change the IIS error settings then simply let the asp-page print the error.
At the top of the file, set
On Error Resume Next
to allow the asp-script to continue executing despite any errors.Then at the possible locations where you suspect error to occur OR just at the bottom of the page; put this code.
IF Err.Number <> 0 THEN Response.Write "=========================================" & "<br />" Response.Write "Error description: " & Err.Description & "<br />" Response.Write "Source: " & Err.Source & "<br />" Response.Write "LineNumber: " & Err.Line & "<br />" Response.Write "=========================================" & "<br />" END IF
The trouble with that solution was that the line number is empty, source just has "Microsoft VBScript runtime error" and most of the other properties of ASPError are blank. (Description has "Overflow" for divide by 0 error). So I still don't really know where the error is :(