Copy link to clipboard
Copied
Hi,
Our users do not want to see the debugging info.
Error on server 1:
Error on server 2:
User wants to see the error as on Server 2 for security reason.
I have compared all the config, and have tried to check/uncheck some debug settings, but no luck.
Can anyone help on this?
Thanks in advance. James
2 Correct answers
The error on server 2 is being presented by IIS, not CF. So, my guess is that you're using a different web server configuration on server 1.
Thank you Dave Wattes for pointing to the right direction. Yes, the difference is on IIS: I solved this by:
IIS->Default Web site->Error Pages-> Right click and select "Open Feature" ->500->Right click, and select "Edit Feature Settings" -> click "Detailed errors for local requests, and custom error page for remote request":
Thanks again!
Copy link to clipboard
Copied
The error on server 2 is being presented by IIS, not CF. So, my guess is that you're using a different web server configuration on server 1.
Copy link to clipboard
Copied
Thank you Dave Wattes for pointing to the right direction. Yes, the difference is on IIS: I solved this by:
IIS->Default Web site->Error Pages-> Right click and select "Open Feature" ->500->Right click, and select "Edit Feature Settings" -> click "Detailed errors for local requests, and custom error page for remote request":
Thanks again!
Copy link to clipboard
Copied
I'm glad you got this resolved! You might want to mark your own answer as correct also. I made a suggestion, you found and documented the solution. So, your answer is more helpful than mine.
Copy link to clipboard
Copied
Dave's explanation of the cause is very likely. I in fact think it is the best.
Unchecking the "Debug Output Settings" in the ColdFusion Administrator is not enough. From what you've said, my suggestion would be that you should let ColdFusion handle errors, for example, by implementing a site-wide error handler.
You can do so in either of the following two ways. Each requires that you create a custom error page, say, errorpage.cfm, to be displayed to the user.
- by means of the onError event-handler in Application.cfc
<!--- Event-handler within Application.cfc ---> <cffunction name="onError"> <cfargument name="Exception" required=true/> <cfargument name = "EventName" type="string" required=true/> <!--- Dump the exception as readable HTML in ColdFusion's log directory (for convenience of developer) ---> <cfdump var="#arguments.exception#" format="html" output="#server.coldfusion.rootDir#\logs\exception_struct_in_onError.html"> <!--- Custom error page to display to user ---> <cfinclude template="/workspace/cf_project/errorPage.cfm" > <cfabort> </cffunction>​
- via the Side-wide Error Handler setting on the page Server Settings > Settings in the ColdFusion Administrator.
In my examples, the location of the error page relative to the web root is /workspace/cf_project/errorpage.cf,m.<html> <!--- Add any custom styling or page design ---> <head> <title>Error</title> </head> <body> <p> Sorry, an error has occurred.</p> We have been made aware of it and are working to fix it. </body> </html>​
Copy link to clipboard
Copied
Thanks BKBK! Yes, Dave's answer is the solution. Your suggestion is excellent. At this moment, our user just wants to see the 500 error because it is the error msg in PROD.
Thanks,
James
Copy link to clipboard
Copied
Hi James,
Thanks for your update.
Copy link to clipboard
Copied
This is the kind of thing I skipped over mentioning because I was typing on my phone, but it's very important to provide a uniform, appropriate way to handle errors as part of your application like @BKBK discussed. It used to be a complete unit in some of Adobe's CF courses, if I recall correctly!
Copy link to clipboard
Copied
Hi Dave Watts,
Yes, I agree with you and BKBK. Since we are migrating database, one server is against one database, and another server is again another database. Basically our users want to make sure our app new server for the new database behaves the same as old server; we would investigate if user sees any discrepency. Yes, for new development, I will take BKBk advise.
Thanks you both!
James

