Met Getlasterror
# ASP GetLastError() Method (ASP 3.0)
* * Complete Server Object Reference Manual](#)
* * *
The GetLastError method returns an ASPError object that describes the error that occurred.
By default, the website uses the file `iishelpcommon500-100.asp` to handle ASP errors. You can use this file or create your own. If you wish to change the ASP file that handles the 500;100 custom error, use the IIS snap-in.
**Note:** A 500;100 custom error is generated if an error occurs while IIS is processing an ASP file or the application's Global.asa.
**Note:** This method is only available before the ASP file has sent any content to the browser.
### Syntax
Server.GetLastError()
## Examples
### Example 1
In this example, an error occurs when IIS attempts to include a file, but the include statement does not use the `file` parameter:
### Example 2
In this example, an error occurs when compiling the script because the keyword "next" is omitted:
### Example 3
In this example, an error occurs because the script attempts to divide a number by zero:
* * Complete Server Object Reference Manual](#)
YouTip