Modifications
I have added to Gavin's work by:- Writing the error to a HTML file so it can be viewed easily in the browser
- Adding a page with a list of all the error files in the logs folder
To create a HTML file for the error change the call to WriteToFile with the code below. Note, I have also changed the path for the PreExecute folder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WriteToFile "C:\Websites\PreExecute\Logs\PreExecuteErrors_" & Year(Now) & Month(Now) & Day(Now) & _ | |
".html", " Date/Time: " & Now() & "<br />" & _ | |
" ASP Code: " & objASPError.ASPCode & "<br />" & _ | |
"ASP Description: " & objASPError.Description & "<br />" & _ | |
" Category: " & objASPError.Category & "<br />" & _ | |
" Column: " & objASPError.Column & "<br />" & _ | |
" Description: " & objASPError.Description & "<br />" & _ | |
" File: " & objASPError.File & "<br />" & _ | |
" Line: " & objASPError.Line & "<br />" & _ | |
" Number: " & objASPError.Number & "<br />" & _ | |
" Source: " & objASPError.Source & "<br />" & _ | |
"############################################################" & "<br />", True |
For the list of errors create a new file in the PreExecute folder called ErrorList.asp and paste in the following script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
sDirectory = "/CMS/PreExecute/Logs/" | |
sPath = Server.MapPath(sDirectory) | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set currentFolder = fso.GetFolder(sPath) | |
Set fileList = currentFolder.Files | |
%> | |
<html> | |
<head> | |
<title>RedDot : PreExecuteErrors</title> | |
</head> | |
<body> | |
<h1>List of files</h1> | |
<ul> | |
<% For Each file in fileList %> | |
<li><a href="<%= sDirectory & file.Name %>"><%= file.Name %></a></li> | |
<% Next %> | |
</ul> | |
</body> | |
</html> | |
<% | |
Set fileList = Nothing | |
Set currentFolder = Nothing | |
Set fso = Nothing | |
%> |
Again, thanks to Gavin for a great bit of lateral thinking which make template development much simpler.
Now if someone can create a plug-in so we can create templates in something other than a web browser, that would be superb.