%CSP.ErrorLog
class %CSP.ErrorLog extends %CSP.Page
This is the default CSP error page. Extend any custom error pages from this class. HyperEventError() defines the response for errors during a hyperevent. Normal HTML output defines the response for errors from a standard page.This error page is designed to avoid leaking sensitive information. The page will log the information to the %ETN system error log and display a simple 'An error has occurred' message to the user.
For a more verbose error page, use %CSP.Error, which will display error log information directly in the page response.
To handle non-core-based licenses, include parameters OTHERSTATICERRORPAGE=1 and PAGENOTFOUNDERRORPAGE = 1.
Two special edge cases are the session timeout and the decryption failure errors. Both of these can be the result of attempting to go to a page when the user's session has timed out or has ended. You may want to redirect them to the login page so they can re-enter the application. To redirect them to the login page, in OnPreHTTP method you can write:
Set errorcode=$get(%request.Data("Error:ErrorNumber",1))
If errorcode=$$$ERRORCODE($$$CSPSessionTimeout)||(errorcode=$$$ERRORCODE($$$InvalidDecrypt)) {
Set %response.Redirect="/application/login.csp"
Quit 1
}
- Error:ErrorCode - The %Status code for this error
- Error:ErrorNumber - The error number assocaited with the ErrorCode
- Error:Namespace - The namespace the page was running in when the error occurred
- Error:URL - The URL of the page in which the error occurred.
- Error:PageName - The name of the page in which the error occurred.
- Error:ResponseContentType - The %response.ContentType at the time of the error.
- Error:ResponseStatus - The %response.Status at the time of the error.
Method Inventory
Parameters
- "" - Return the 404 Page not found error (this is the default)
- Path to a static HTML page - Will display this static page, for example '/csp/samples/static.html' will use the stream server to serve up this static file. This does not require a license, but it will only work with static content.
- "" - Return the 404 Page not found error (this is the default)
- 1 - Will obtain a license and display the standard error page.
- Path to a static HTML page - Will display this static page, for example '/csp/samples/static.html' will use the stream server to serve up this static file. This does not require a license, but it will only work with static content.
- "" - Return the 404 Page not found error (this is the default)
- 1 - Will obtain a license and display the standard error page.
- Path to a static HTML page - Will display this static page, for example '/csp/samples/static.html' will use the stream server to serve up this static file. This does not require a license, but it will only work with static content.
Methods
You could use this javascript to redirect the browser to another page:
Write "CSPPage.window.location='/csp/samples/menu.csp';",!
Write "alert('An error occurred');",!
Inherited Members
Inherited Methods
- %ClassIsLatestVersion()
- %ClassName()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %Extends()
- %GetParameter()
- %IsA()
- %New()
- %OriginalNamespace()
- %PackageName()
- %SetModified()
- ConvertParameter()
- Decrypt()
- Encrypt()
- EscapeHTML()
- EscapeURL()
- HyperEventCall()
- HyperEventHead()
- Include()
- InsertHiddenField()
- InsertHiddenFields()
- IsPrivate()
- Link()
- OnHTTPHeader()
- OnPageError()
- OnPostHTTP()
- OnPostHyperEvent()
- OnPreHTTP()
- OnPreHyperEvent()
- Page()
- QuoteJS()
- RewriteURL()
- ShowError()
- StartTimer()
- StopTimer()
- ThrowError()
- UnescapeHTML()
- UnescapeURL()