Classic ASP ASPError Object

Last updated: August 26, 2026.

Server.GetLastError() returns an ASPError object on a configured custom error page. Log technical details privately and return a generic message to visitors.

Custom 500 error page

<%@ Language="VBScript" %>
<%
Dim errorInfo
Set errorInfo = Server.GetLastError()

' Send details to protected logging infrastructure.
Response.Status = "500 Internal Server Error"
Response.Write "The request could not be completed."

Set errorInfo = Nothing
%>

Useful properties

PropertyMeaning
NumberError number
SourceComponent or source
File, LineLocation of the failing ASP code
DescriptionError description
ASPCodeIIS ASP error code

Configure the page through IIS Error Pages. Do not display file paths, SQL text, credentials, or stack details to public users.

admin

admin

Leave a Reply

Your email address will not be published.