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>



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Can I use CFExecute? (Views: 1634)

* ASP is only available on Windows

Home Page
About
Web Hosting
FAQ
Get Support
Script Downloads

Coldfusion Hosting
ASP Hosting
Linux Hosting
Railo Hosting

Terms of Service
Privacy Policy
Affiliate Program

* ASP is only available on Windows.