CFError and Email Report

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default CFError and Email Report

    I want an email to be triggered with details of any errors a customer has
    whilst on our website. Running CFMX 7.

    I have read that CFML will only work on the error page if it's a Monitor or
    Exception error.

    If I put type="monitor" then i get:

    Attribute validation error for tag CFERROR.
    The value of the attribute type, which is currently "monitor", is invalid.

    If I use exception, it doesn't not pick up the errors i'm expecting to get....

    Request: Picks up the errors and displays my customer error page, but does not
    trigger the email because it doesn't allow full CFML processing, and instead
    displays the email content on the webpage.

    The errors i'm expecting to pick up are CFHTTP timeouts, and possibly missing
    variables.. (if someone deletes from URL)

    So,
    Does anyone know why Type="Monitor" doesn't work?
    And how I can get it to trigger an email when my only option appears
    Type="Request" ?

    Thanks, Dan

    Stormpool Guest

  2. Similar Questions and Discussions

    1. cferror and Server Name
      Hello All, We have an exception handler page that will email us the page the user was on and the page the user was trying to get to. My question...
    2. cferror question??
      Hi all... I am using cferror to catch errors in our site and am able to catch every type of error except for a "database" error. Here is what our...
    3. CFERROR
      Hi. I am just testing a simple site to try cf. The header is in application.cfm and the fotter in OnRequestEnd.cfm The main page is the requested...
    4. ASP/CDO verify email address from Exchange 2000 non-delivery report
      Apologies for the cross-post but i thought i'd aim for the largest audience possible. I have a web site that users have to register to with their...
    5. How to link 3 different combo boxex in a form (as report criteria) to the report
      I would like to use 3 combo boxes in a form as parameter criteria for a report. When I open a report, there will be a pop up form with 3 combo...
  3. #2

    Default Re: CFError and Email Report

    > I want an email to be triggered with details of any errors a customer has
    > whilst on our website. Running CFMX 7.
    >
    > I have read that CFML will only work on the error page if it's a Monitor
    or
    > Exception error.
    >
    > If I put type="monitor" then i get:
    >
    > Attribute validation error for tag CFERROR.
    > The value of the attribute type, which is currently "monitor", is
    invalid.

    Monitor error type is deprecated since CFMX 6.

    > If I use exception, it doesn't not pick up the errors i'm expecting to
    get....

    You can use the new onError event from Application.cfc

    --
    <mack />


    Neculai Macarie Guest

  4. #3

    Default Re: CFError and Email Report

    This is kinda old hat, but my error handling page is

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

    <html>
    <head>
    <title>Error Occurred - Please Retry</title>
    </head>

    <body><cfoutput>

    <form name="sendit" action="errorhandler.cfm" method="post">
    <div style="visibility: hidden">
    <textarea name="message" rows="1" cols="1">Error Message:
    #error.diagnostics#</textarea></div>
    <input type="hidden" name="datetime" value="Date/Time: #error.datetime#">
    <input type="hidden" name="browser" value="Browser: #error.browser#">
    <input type="hidden" name="referrer" value="Referring Page:
    #error.httpreferer#">
    <input type="hidden" name="address" value="Remote Address:
    #error.remoteaddress#">
    <input type="hidden" name="template" value="Requested Page: #error.template#">
    <input type="hidden" name="mailaddress" value="#error.mailto#">
    </form>
    </cfoutput>
    <script language="JavaScript1.2">sendit.submit()</script>
    </body>
    </html>

    This passes the error values automatically to errorhandler.cfm, which can send
    email, and does.

    (BTW I require Javascript on my site. Sorry.)

    HTH,

    philh Guest

  5. #4

    Default Re: CFError and Email Report

    Put this in your /Application.cfm:

    <cferror
    type="EXCEPTION"
    template="includes/inc_errcatch.cfm">

    (of course name the file and place it wherever you want). The
    type="EXCEPTION" cferror statement is a blanket error handler that will let you
    use any CF code you please. So what you want to do next is to dump out the
    CFERROR scope so you can see what the reported error details are. Next you
    probably also want to dump out most if not everything in memory so you can
    diagnose the problem.

    So a quick way to do that is shown in the code window. This will dump out
    every scope named in the list parameter (change them as you see fit). The data
    will then all be sitting in a nice fat variable (in this case "dataDump") that
    you can cfoutput into an email message or a database record (don't try that
    with Access as an Access memo field may not be big enough) or store on disk in
    a discrete .html file.

    Security and size are issues when you dump out data like this. I wrote up a
    tutorial that covers the lot that was geared to a site-wide error handler, but
    it can easily be used with an app-specific error handler as well.

    [url]http://mysecretbase.com/Building_A_ColdFusion_Error_Handler.cfm[/url]

    HtH,

    --Matt--
    MSB Web Systems... [url]http://mysecretbase.com[/url]
    If all you have is a hammer, everything looks like a nail.
    - Baruch's Observation


    <cfsavecontent variable="dataDump">
    <cfloop

    list="ERROR,APPLICATION,ATTRIBUTES,CALLER,CGI,CLIE NT,FORM,REQUEST,SESSION,SERVE
    R,THIS,THISTAG,URL,VARIABLES"
    index="loopItem">
    <cfif IsDefined("#loopItem#")>
    <cfdump
    var="#Evaluate(loopItem)#"
    label="#loopItem#">
    </cfif>
    </cfloop>
    </cfsavecontent>

    MattRobertson Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139