Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

FuseBox 5 - Error handling Template

Participant ,
Dec 12, 2008 Dec 12, 2008
Hi all,
I have created an error handling cfm page but dont know how to embed in fusebox 5..Any idea?
Or if you have one on hand that might help as well..Thank you alll.
TOPICS
Advanced techniques
2.8K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 12, 2008 Dec 12, 2008
Hi,

Open up your fusebox.xml file and go through the <plugins> section, there you can see two elements namely,

i) fuseactionException
ii) processError

Call your error handling template as plugin like this,

(Before that copy your error handling template into the "plugins" directory).

<phase name="processError">
<plugin name="errorHandler" template="your_error_page.cfm" />
</phase>

HTH
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 13, 2008 Dec 13, 2008
Good morning man,
I have added the line with "cferror.cfm" everthing else on the attached code was there before, and also i moved the cferror.cfm into plugin directory...Now I am not able to login to the application...

Getting this error:
Context validation error for tag cftry. The start tag must have a matching end tag. This could be because CFCATCH is not the last tag nested in the CFTRY. CFCATCH must be the last tag inside a CFTRY. <br>The error occurred on line 228.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 13, 2008 Dec 13, 2008
Are you looking to customize the generic error template or create special ones? It looks from the fusebox.xml code above that you are just calling some standard error handlers. If so, you have the option to just update the genericErrorMessage.cfm template inside the Fusebox errortemplates folder.

For the error noted above, I imagine you did but have you since restarted CF or reparsed the Fusebox application*? Also, can you show a little code from cferror.cfm? My sense is that the FB error points to that file.

*If you don't have it, there is a handy Firefox extension called "Reload Fusebox" (https://addons.mozilla.org/en-US/firefox/addon/6664) that offers a quick and easy way to reload your Fusebox applications by right-clicking on a Fusebox page.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 13, 2008 Dec 13, 2008
the cferror.cfm has just <cfdump var="#error#"> and emailing the error...The one I have is custom..
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 15, 2008 Dec 15, 2008
Emmim44,

Like Craig said, this might be occuring because of the parsed code, which you can clear either using the Firefox plugin suggested by craig,

or appending loadclean=true&parseall=true to your url...

HTH
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 15, 2008 Dec 15, 2008
I did use the "loadclean=true&parseall=true " as follow " http://10.156.76.177/scorecard33/index.cfm?loadclean=true&parseall=true" and getting this error..

--------
Context validation error for tag cftry.
The start tag must have a matching end tag. This could be because CFCATCH is not the last tag nested in the CFTRY. CFCATCH must be the last tag inside a CFTRY.

The error occurred in C:\Inetpub\wwwroot\Scorecard33\parsed\login.default.cfm: line 5
Called from C:\Inetpub\wwwroot\Scorecard33\fusebox5\Application.cfc: line 228
Called from C:\Inetpub\wwwroot\Scorecard33\fusebox5\Application.cfc: line 218
Called from C:\Inetpub\wwwroot\Scorecard33\fusebox5\fusebox5.cfm: line 57
Called from C:\Inetpub\wwwroot\Scorecard33\index.cfm: line 3

3 : <!--- circuit: login --->
4 : <!--- fuseaction: default --->
5 : <cftry>
6 : <cfset myFusebox.thisPhase = "preProcess">
7 : <cfset myFusebox.thisCircuit = "login">


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 15, 2008 Dec 15, 2008
And cferror.cfm
--
<html>
<head>
<title>Error occured</title>
<style type="text/css">
<!--
.style1 { font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; color: #CC6600; }
-->
</style>
</head>
<body>

<div align="center">
<img src="../Scorecard33/images/scorecard_NEWYORK.jpg" border="0"><br><br>
<span class="style1">The requested page is temporarily unavailable... Please <a href="javascript:history.go(-1)">go back</a> re-visit it in approximately 30 mins.</span>
</div>
</body>
</html>

<cfmail to="veysi.ozturk@tc.com" from="SC_APP_Errors@tc.com" subject="An Error occured on #cgi.server_name#" type="HTML">
<cfmailpart type="html">
<p>
An error occurred at
#DateFormat( Now(), "mmm d, yyyy" )# at
#TimeFormat( Now(), "hh:mm TT" )#
</p>
<cfdump var="#error#" label="Error message">
<cfdump var="#session#" label="Session scope">
<!---cfdump var="#application#" label="Application scope">
<cfdump var="#request#" label="Request scope">
<cfdump var="#form#" label="Form scope">
<cfdump var="#url#" label="URL scope">
<cfdump var="#cookie#" label="Cookie scope">
<p>#error.diagnostics#</p--->
</cfmailpart>
</cfmail>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 15, 2008 Dec 15, 2008
emmim44,

Try changing this line:
.style1 { font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; color: #CC6600; }

to
.style1 { font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; color: ##CC6600; }

The error could be something as simple as the single # sign in this CSS declaration (working on the assumption that a CFOUTPUT block might be wrapping this somewhere along the way).

I would also use the reparse/reload commands for the FB application each time while testing to get rid of this fix (just to ensure that FB is recreating your cached files cleanly).

Also, what's on line 228 of Application.cfc (curious where the call is originating from).
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 15, 2008 Dec 15, 2008
still doesnt work after replacing "#" with "##"...same error.

Line 228 on application.cfc is
<cflock name="#_parsedFileData.lockName#" type="readonly" timeout="30">
<cfinclude template="#_parsedFileData.parsedFile#" />
</cflock>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 16, 2008 Dec 16, 2008
Hi,

Try chaning the your "mode" parameter's value from"developemnt" to "production" like,

<parameter name="mode" value="production" />

if you still happen to receive the same error after the modification try renaming your application name in your index.cfm and re-run your application with loadclean=true&parseall=true.

HTH
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 16, 2008 Dec 16, 2008
I followed your procedures Daverms but still same error...What else is wrong?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 16, 2008 Dec 16, 2008
LATEST
After changing the precedence of those {
<phase name="processError">
<plugin name="errorHandler" template="cferror.cfm" />
<plugin name="exception" template="fct_exception.cfm" />
</phase>>

}
It went to login page but now I am getting this error...

Variable ERROR is undefined.


The error occurred in C:\Inetpub\wwwroot\Scorecard33\parsed\login.default.cfm: line 63
Called from C:\Inetpub\wwwroot\Scorecard33\fusebox5\Application.cfc: line 228
Called from C:\Inetpub\wwwroot\Scorecard33\fusebox5\Application.cfc: line 218
Called from C:\Inetpub\wwwroot\Scorecard33\fusebox5\fusebox5.cfm: line 57
Called from C:\Inetpub\wwwroot\Scorecard33\index.cfm: line 3

61 : #TimeFormat( Now(), "hh:mm TT" )#
62 : </p>
63 : <cfdump var="#error#" label="Error message">
64 : <cfdump var="#session#" label="Session scope">


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources