Name
Source —
objASPError.Source
Synopsis
The Source property is a string containing the line of code that caused the most recent error, if that code was syntactically incorrect.
Parameters
None
Example
This example uses the error-generating scripts listed at the end of the Comments/Troubleshooting section. It assumes that the following code has been added to the default custom error script, 500-100.ASP:
**** BEGIN Source Example Script **** <% ' This script demonstrates the use of the Source ' property of the ASPError object. Dim objMyASPError Set objMyASPError = Server.GetLastError( ) Response.Write "The value of the Source property is " & objMyASPError.Source %> **** END Source Example Script ****
When the error-generating scripts are executed, the preceding Source script generates the following three responses:
Error Generating Script #1:
The value of the Source property is Fir intCounter = 1 to 100Error Generating Script #2:
The value of the Source property is [EMPTY]
Error Generating Script #3:
The value of the Source property is [EMPTY]
Notes
As mentioned previously, the Source property is only useful if the error produced is syntax-related. Otherwise, this property is empty.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access