Open ASP at the server level (not at the site) and enable "Log errors to NT log". Then check the Application eventlog for the error.
Log Name: Application
Source: Active Server Pages
Date: 11/5/2022 4:35:58 PM
Event ID: 9
Task Category: None
Level: Warning
Keywords: Classic
User: N/A
Computer: Test10
Description:
Warning: File /test.asp Line 23 Include file not found. The include file 'common.inc' was not found..
You should also see the error in the IIS log.
2022-11-05 20:34:11 192.168.1.5 GET /test.asp |23|ASP_0126|Include_file_not_found 80 - 192.168.1.4 Mozilla/5.0+(Windows+NT+10.0;+Win64;+x64)+AppleWebKit/537.36+(KHTML,+like+Gecko)+Chrome/107.0.0.0+Safari/537.36+Edg/107.0.1418.26 - 500 0 0 266
If you want the error to be displayed to the client then I believe that you would need to implement a custon 500-100 error page.