Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

How do I get error to be send to my email from application.cfc?

$
0
0

From the ddocumentation

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24 -7d39.html#WSc3ff6d0ea77859461172e0811cbec22c24-7cce

 

I been following the steps inserting the code into application.cfc

<cfcomponent output="false" hint="Prevent security attacks where an unauthorized party attempts to access coldfusion files under /CFIDE/scripts/ajax/FCKeditor/editor/filemanager folder">  <cfset this.name = "fckeditor_filemanager">  <cffunction name="onRequestStart">  <cfargument name="targetpage" required=true type="string" />  <cfset verifyClient()>  <cfreturn true>  </cffunction><cfcomponent><cfset This.name = "BugTestApplication"><cffunction name="onError">    <!--- The onError method gets two arguments:            An exception structure, which is identical to a cfcatch variable.            The name of the Application.cfc method, if any, in which the error            happened.    <cfargument name="Except" required=true/>    <cfargument type="String" name = "EventName" required=true/>    <!--- Log all errors in an application-specific log file. --->    <cflog file="#This.Name#" type="error" text="Event Name: #Eventname#" >    <cflog file="#This.Name#" type="error" text="Message: #except.message#">    <!--- Throw validation errors to ColdFusion for handling. --->    <cfif Find("coldfusion.filter.FormValidationException",                     Arguments.Except.StackTrace)>        <cfthrow object="#except#">    <cfelse>        <!--- You can replace this cfoutput tag with application-specific                 error-handling code. --->        <cfoutput>            <p>Error Event: #EventName#</p>            <p>Error details:<br>            <cfdump var=#except#></p>        </cfoutput>    </cfif></cffunction></cfcomponent>

 

But when I test it doesnt seem to be doing anything.obviously it still gives me a error , which it should,.

I have use the test example code they gave in the bottom but that just gives me a

regular error.

error.PNG

 

<cfform>    This box does Integer validation:     <cfinput name="intinput" type="Text" validate="integer" validateat="onServer"><br>    Check this box to throw an error on the action page:    <cfinput type="Checkbox" name="throwerror"><br>    <cfinput type="submit" name="submitit">    </cfform><cfif IsDefined("form.fieldnames")>    <cfif IsDefined("form.throwerror")>        <cfthrow type="ThrownError" message="This error was thrown from the bugTest action page.">    <cfelseif form.intinput NEQ "">        <h3>You entered the following valid data in the field</h3>        <cfoutput>#form.intinput#</cfoutput>    </cfif></cfif>

 

Eventually i would like to make it send a email to me, how would i be able to accomplish this?


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>