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
| Property | Meaning |
|---|---|
Number | Error number |
Source | Component or source |
File, Line | Location of the failing ASP code |
Description | Error description |
ASPCode | IIS ASP error code |
Configure the page through IIS Error Pages. Do not display file paths, SQL text, credentials, or stack details to public users.