having small problem ith cferror
Hey people. I have the following cferror code for my custom error messages, but it won't work for missng templates. Not sure why have search high and low on the adobe forums and came out empty. Any help would be great.
=== Application.cfc ===
<cfcomponent>
<cferror type="Request" template="errormessage.cfm"
mailto="sample@gmail.com">
<cferror type="Exception" template="errormessage.cfm"
mailto="sample@gmail.com">
<cferror type="Validation" template="errormessage.cfm"
mailto="sample@gmail.com">
<cffunction name="onRequestStart">
<cflogin>
<cfif IsDefined("FORM.Login_btn")>
<cfquery name="qLogin" datasource="poll">
SELECT UserLogin, UserPassword, UserRoleID
FROM Users
WHERE UserLogin = <cfqueryparam value="#cflogin.Name#" cfsqltype="cf_sql_varchar">
AND UserPassword = <cfqueryparam value="#cflogin.Password#" cfsqltype="cf_sql_varchar">
</cfquery>
<cfif cflogin.name IS "#qLogin.UserLogin#" AND cflogin.password IS "#qLogin.UserPassword#">
<cfloginuser name="#cflogin.name#"
password="#cflogin.password#"
roles="#qLogin.UserRoleID#">
<cfelse>
<cfset request.errorMsg = "Incorrect login; please try again">
<cfinclude template="../login/login.cfm">
<cfabort />
</cfif>
<cfelse>
<cfinclude template="../login/login.cfm">
<cfabort />
</cfif>
</cflogin>
</cffunction>
</cfcomponent>
=== errormessage.cfm ===
<!---
Filename: ErrorException.cfm
Created by: Nate Weiss (NMW)
Please Note: Included via <CFERROR> in Application.cfc
--->
<html>
<head><title>Error</title></head>
<body>
<!--- Display sarcastic message to poor user --->
<h2>OOPS Something happened</h2><br><br>
Not sure what went wrong, but the admin has been notified about this problem and we will have if fixed soon. <br>
Sorry for the inconvenience.
<!--- Send an email message to site administrator --->
<!--- (or whatever address provided to <cferror>) --->
<cfif ERROR.mailTo neq "">
<cfmail to="#ERROR.mailTo#" from="errorsender@orangewhipstudios.com"
subject="Error on Page #ERROR.Template#">
Error Date/Time: #ERROR.dateTime#
User’s Browser: #ERROR.browser#
URL Parameters: #ERROR.queryString#
Previous Page: #ERROR.HTTPReferer#
------------------------------------
#ERROR.diagnostics#
</cfmail>
</cfif>
</body>
</html>
Thanks in advanced
