Knowledgebase
Portal Home > Knowledgebase > Coldfusion > With ColdFusion, how can I see the real error, while the visitor sees a page without the error?
With ColdFusion, how can I see the real error, while the visitor sees a page without the error?
A: Here is an example. Be sure to replace 123.123.123.123 with your IP. You can get your IP by displaying the value of aIP after it is set.
<cfset aIP = cgi.REMOTE_ADDR>
<cfif aIP is "123.123.123.123">
<cfoutput>
<br>
<strong>#error.Diagnostics#</strong>
<br>
<br>
#TimeFormat(error.DateTime,"hh:mm tt")# - #DateFormat(error.DateTime,"MMMM
D, YYYY")#
<br>
<br>
#error.Browser#
<br><br>
IP ADDRESS:
#error.RemoteAddress#
<br><br>
TEMPLATE: #error.Template#?#error.QueryString#
<br><br>
#error.ValidationHeader#
<br><br>
#error.InvalidFields#
<br><br>
#error.ValidationFooter#
</cfoutput>
<cfelse>
Enter any text or formatting here that you want to display to your visitor instead of
them seeing the error.
</cfif>
Add to Favourites Print this Article
* ASP is only available on Windows
Home Page |
||
* ASP is only available on Windows. |