Email Site-Wide Error message (with code snippet)

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

  1. #1

    Default Email Site-Wide Error message (with code snippet)

    I would like to create a Site-Wide error message that is emailed to the
    administrator. I have a lot of the information I want to put in but I can not
    figure out how to include the code snippet that is included in the standard
    CFMX 6.1 error message. This is very helpful in debuging seeing the source
    code and the line numbers. Does anyone know how to get this?

    Error

    --------------------------------------------------------------------------------
    --------------------
    Variable WHATISTHIS is undefined.

    The error occurred in E:\Intranet\Global\Support\Test2.cfm: line 12

    10 : <cfoutput>
    11 : My Variables: #MyVar#<br />
    12 : My Error Var: #WhatIsThis#<br />
    13 : </cfoutput>
    14 : </body>


    --------------------------------------------------------------------------------
    --------------------

    Thanks
    Dwight

    Dwight Guest

  2. Similar Questions and Discussions

    1. Site wide error
      I have this in the site wide error box C:\error.cfm I know the page is there... But when I go to a page with an error on it, I can still see all...
    2. CFMX 6.1 Site Wide Error handler NOT working
      We have many servers running CFMX 6.1 (app.commonapp.org thru app4.commonapp.org and beyond), each has an identical CF configuration however 2 of...
    3. CFERROR vs. site-wide error handler
      Okay... I posted a comment in livedocs about the lack of any criteria for how to decide between using CFERROR and a site-wide error handler set up...
    4. Site-wide Error Handler
      The Site-wide Error Handler page is loading , sometimes, at the top of a page that has been requested. This error does not show for all page users....
    5. how to get error message when you using Site-wide ErrorHandler
      Hi, Right now, I am try to setting coldfusion 5 using Site-wide Error Handler. Instead of using try catch to report error. however, it just...
  3. #2

    Default Re: Email Site-Wide Error message (with code snippet)

    I email my self the following which I find very handy!
    Stressed_Simon Guest

  4. #3

    Default Re: Email Site-Wide Error message (with code snippet)

    Simon,
    Thanks for your reply. None of the code you provided gives me the code
    snippet of where the error occurred in the code. I would like to get this:

    10 : <cfoutput>
    11 : My Variables: #MyVar#<br />
    12 : My Error Var: #WhatIsThis#<br />
    13 : </cfoutput>
    14 : </body>

    The doce you provided gave me this:
    Address: 131.167.69.241
    Template: /Global/Support/Test2.cfm or E:\Intranet\Global\Support\Test2.cfm
    URL String:
    Date: {ts '2005-05-05 12:43:15'}
    Message: Variable WHATISTHIS is undefined.
    The error occurred on line 12.
    Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR
    1.1.4322)
    Generated Content: My Variables: 5
    My Error Var:
    Referer:
    Java Root Cause: coldfusion.runtime.UndefinedVariableException: Variable
    WHATISTHIS is undefined.
    Stack Trace: coldfusion.runtime.UndefinedVariableException: Variable
    WHATISTHIS is undefined. at coldfusion.runtime.CfJspPage._get(Unknown Source)
    at coldfusion.runtime.CfJspPage._autoscalarize(Unknow n Source) at
    cfTest22ecfm1790952765.runPage(E:\Intranet\Global\ Support\Test2.cfm:12) at
    coldfusion.runtime.CfJspPage.invoke(Unknown Source) at
    coldfusion.tagext.lang.IncludeTag.doStartTag(Inclu deTag.java:357) at
    coldfusion.filter.CfincludeFilter.invoke(Cfinclude Filter.java:62) at
    coldfusion.filter.ApplicationFilter.invoke(Applica tionFilter.java:107) at
    coldfusion.filter.RequestMonitorFilter.invoke(Requ estMonitorFilter.java:43) at
    coldfusion.filter.PathFilter.invoke(PathFilter.jav a:80) at
    coldfusion.filter.ExceptionFilter.invoke(Exception Filter.java:47) at
    coldfusion.filter.ClientScopePersistenceFilter.inv oke(ClientScopePersistenceFilt
    er.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilt er.java:35) at
    coldfusion.filter.GlobalsFilter.invoke(GlobalsFilt er.java:43) at
    coldfusion.filter.DatasourceFilter.invoke(Datasour ceFilter.java:22) at
    coldfusion.CfmServlet.service(CfmServlet.java:105) at
    jrun.servlet.ServletInvoker.invoke(ServletInvoker. java:91) at
    jrun.servlet.JRunInvokerChain.invokeNext(JRunInvok erChain.java:42) at
    jrun.servlet.JRunRequestDispatcher.invoke(JRunRequ estDispatcher.java:252) at
    jrun.servlet.ServletEngineService.dispatch(Servlet EngineService.java:527) at
    jrun.servlet.jrpp.JRunProxyService.invokeRunnable( JRunProxyService.java:192) at
    jrunx.scheduler.ThreadPool$DownstreamMetrics.invok eRunnable(ThreadPool.java:348)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRu nnable(ThreadPool.java:451)
    at
    jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeR unnable(ThreadPool.java:294)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java :66)

    Any idea which error variable that gives the code snippet? Or is there a way
    to capture the standard CF error and email it?

    Thanks
    Dwight

    Dwight Guest

  5. #4

    Default Re: Email Site-Wide Error message (with code snippet)

    I don't think you can get the actual code snippet but you do get what the
    problem is and what line it occurred on and in what file. Which is pretty much
    all you need. I find all that info invaluable and normally get most things
    sorted without too much drama.

    Stressed_Simon Guest

  6. #5

    Default Re: Email Site-Wide Error message (with code snippet)

    Thanks Simon! You're right it does give you everything that you need, its just
    so much nicer to see the code snippet. I figured that since the standard error
    can do it that there would be a way to do it by a variable or something.

    Thanks
    Dwight

    Dwight Guest

  7. #6

    Default Re: Email Site-Wide Error message (with code snippet)

    This looks really useful, but I don't know where to stick this code so that errors get sent to me. Can you please give a newbie to this some information about how to do this?

    Thanks,

    Oak
    oak3 Guest

  8. #7

    Default Re: Email Site-Wide Error message (with code snippet)

    You need to read up on cferror
    [url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-p24.htm#wp2022557[/url]

    Thje create a template to handle the error. At the top place a cfmail tag with
    the info from the earlier threads.

    HTH

    Stressed_Simon 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