| 1 | <cfprocessingdirective pageencoding="utf-8"> |
|---|
| 2 | <!--- |
|---|
| 3 | Name : error.cfm |
|---|
| 4 | Author : Raymond Camden |
|---|
| 5 | Created : March 20, 2005 |
|---|
| 6 | Last Updated : April 20, 2007 |
|---|
| 7 | History : Show error if logged in. (rkc 4/4/05) |
|---|
| 8 | BD didn't like error.rootcause (rkc 5/27/05) |
|---|
| 9 | PaulH added locale strings (rkc 7/22/05) |
|---|
| 10 | Use of rb() (rkc 8/20/06) |
|---|
| 11 | Left a or 1 in the code, bad Ray (rkc 4/20/07) |
|---|
| 12 | Purpose : Handles errors |
|---|
| 13 | ---> |
|---|
| 14 | |
|---|
| 15 | <!--- Send the error report ---> |
|---|
| 16 | <cfset blogConfig = application.blog.getProperties()> |
|---|
| 17 | |
|---|
| 18 | <cfsavecontent variable="mail"> |
|---|
| 19 | <cfoutput> |
|---|
| 20 | #rb("errorOccured")#:<br> |
|---|
| 21 | <table border="1" width="100%"> |
|---|
| 22 | <tr> |
|---|
| 23 | <td>#rb("date")#:</td> |
|---|
| 24 | <td>#dateFormat(now(),"m/d/yy")# #timeFormat(now(),"h:mm tt")#</td> |
|---|
| 25 | </tr> |
|---|
| 26 | <tr> |
|---|
| 27 | <td>#rb("scriptName")#:</td> |
|---|
| 28 | <td>#cgi.script_name#?#cgi.query_string#</td> |
|---|
| 29 | </tr> |
|---|
| 30 | <tr> |
|---|
| 31 | <td>#rb("browser")#:</td> |
|---|
| 32 | <td>#error.browser#</td> |
|---|
| 33 | </tr> |
|---|
| 34 | <tr> |
|---|
| 35 | <td>#rb("referer")#:</td> |
|---|
| 36 | <td>#error.httpreferer#</td> |
|---|
| 37 | </tr> |
|---|
| 38 | <tr> |
|---|
| 39 | <td>#rb("message")#:</td> |
|---|
| 40 | <td>#error.message#</td> |
|---|
| 41 | </tr> |
|---|
| 42 | <tr> |
|---|
| 43 | <td>#rb("type")#:</td> |
|---|
| 44 | <td>#error.type#</td> |
|---|
| 45 | </tr> |
|---|
| 46 | <cfif structKeyExists(error,"rootcause")> |
|---|
| 47 | <tr> |
|---|
| 48 | <td>#rb("rootCause")#:</td> |
|---|
| 49 | <td><cfdump var="#error.rootcause#"></td> |
|---|
| 50 | </tr> |
|---|
| 51 | </cfif> |
|---|
| 52 | <tr> |
|---|
| 53 | <td>#rb("tagContext")#:</td> |
|---|
| 54 | <td><cfdump var="#error.tagcontext#"></td> |
|---|
| 55 | </tr> |
|---|
| 56 | </table> |
|---|
| 57 | </cfoutput> |
|---|
| 58 | </cfsavecontent> |
|---|
| 59 | |
|---|
| 60 | <cfif blogConfig.mailserver is ""> |
|---|
| 61 | <cfmail to="#blogConfig.owneremail#" from="#blogConfig.owneremail#" type="html" subject="Error Report">#mail#</cfmail> |
|---|
| 62 | <cfelse> |
|---|
| 63 | <cfmail to="#blogConfig.owneremail#" from="#blogConfig.owneremail#" type="html" subject="Error Report" |
|---|
| 64 | server="#blogConfig.mailserver#" username="#blogConfig.mailusername#" password="#blogConfig.mailpassword#">#mail#</cfmail> |
|---|
| 65 | </cfif> |
|---|
| 66 | |
|---|
| 67 | <cfmodule template="tags/layout.cfm"> |
|---|
| 68 | |
|---|
| 69 | <cfoutput> |
|---|
| 70 | <div class="date">#rb("errorpageheader")#</div> |
|---|
| 71 | <div class="body"> |
|---|
| 72 | <p> |
|---|
| 73 | #rb("errorpagebody")# |
|---|
| 74 | </p> |
|---|
| 75 | <cfif isUserInRole("admin")> |
|---|
| 76 | <cfoutput>#mail#</cfoutput> |
|---|
| 77 | </cfif> |
|---|
| 78 | </div> |
|---|
| 79 | </cfoutput> |
|---|
| 80 | |
|---|
| 81 | </cfmodule> |
|---|