Show error on TEST site, send email on live:

An error occurred within the States.HomeTownLocator.com web site, the details are as follows:
Time: {ts '2018-06-21 12:08:11'}
Server: htl-test.com
CGI Server: htl-test.com
Error Template: /index.cfm
Http Referer:
Browser used: CCBot/2.0 (http://commoncrawl.org/faq/)
Error Type: coldfusion.runtime.CfErrorWrapper
Error message: Element STATECODE is undefined in APPLICATION.
QueryString:
Error Diagnostics : Element STATECODE is undefined in APPLICATION.
The error occurred on line 143.
error - struct
Browser CCBot/2.0 (http://commoncrawl.org/faq/)
DateTime {ts '2018-06-21 12:08:11'}
Diagnostics Element STATECODE is undefined in APPLICATION. <br>The error occurred on line 143.
GeneratedContent [empty string]
HTTPReferer [empty string]
Mailto [empty string]
Message Element STATECODE is undefined in APPLICATION.
QueryString [empty string]
RemoteAddress 192.168.10.8
RootCause
error - struct
Detail [empty string]
ErrNumber 0
Message Element STATECODE is undefined in APPLICATION.
Resolvedname APPLICATION
StackTrace coldfusion.runtime.UndefinedElementException: Element STATECODE is undefined in APPLICATION. at coldfusion.runtime.CfJspPage.resolveCanonicalName(CfJspPage.java:1748) at coldfusion.runtime.CfJspPage._resolve(CfJspPage.java:1701) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1850) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1829) at cfApplication2ecfc864992145$funcONAPPLICATIONSTART.runFunction(D:\Websites\States.HomeTownlocator.com\HTDocs\Application.cfc:143) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414) at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:108) at coldfusion.runtime.AppEventInvoker.onApplicationStart(AppEventInvoker.java:231) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:309) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:112) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:219) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:450) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:197) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
Suppressed
error - array [empty]
TagContext
error - array
1
error - struct
COLUMN 0
ID ??
LINE 143
RAW_TRACE at cfApplication2ecfc864992145$funcONAPPLICATIONSTART.runFunction(D:\Websites\States.HomeTownlocator.com\HTDocs\Application.cfc:143)
TEMPLATE D:\Websites\States.HomeTownlocator.com\HTDocs\Application.cfc
TYPE CFML
Type Expression
element STATECODE
objectType
error - object of java.lang.Class
Class Name java.lang.Class
Methods
Method Return Type
asSubclass(java.lang.Class) java.lang.Class
cast(java.lang.Object) java.lang.Object
desiredAssertionStatus() boolean
forName(java.lang.String) java.lang.Class
forName(java.lang.String, boolean, java.lang.ClassLoader) java.lang.Class
getAnnotatedInterfaces() java.lang.reflect.AnnotatedType[]
getAnnotatedSuperclass() java.lang.reflect.AnnotatedType
getAnnotation(java.lang.Class) java.lang.annotation.Annotation
getAnnotations() java.lang.annotation.Annotation[]
getAnnotationsByType(java.lang.Class) java.lang.annotation.Annotation[]
getCanonicalName() java.lang.String
getClassLoader() java.lang.ClassLoader
getClasses() java.lang.Class[]
getComponentType() java.lang.Class
getConstructor(java.lang.Class[]) java.lang.reflect.Constructor
getConstructors() java.lang.reflect.Constructor[]
getDeclaredAnnotation(java.lang.Class) java.lang.annotation.Annotation
getDeclaredAnnotations() java.lang.annotation.Annotation[]
getDeclaredAnnotationsByType(java.lang.Class) java.lang.annotation.Annotation[]
getDeclaredClasses() java.lang.Class[]
getDeclaredConstructor(java.lang.Class[]) java.lang.reflect.Constructor
getDeclaredConstructors() java.lang.reflect.Constructor[]
getDeclaredField(java.lang.String) java.lang.reflect.Field
getDeclaredFields() java.lang.reflect.Field[]
getDeclaredMethod(java.lang.String, java.lang.Class[]) java.lang.reflect.Method
getDeclaredMethods() java.lang.reflect.Method[]
getDeclaringClass() java.lang.Class
getEnclosingClass() java.lang.Class
getEnclosingConstructor() java.lang.reflect.Constructor
getEnclosingMethod() java.lang.reflect.Method
getEnumConstants() java.lang.Object[]
getField(java.lang.String) java.lang.reflect.Field
getFields() java.lang.reflect.Field[]
getGenericInterfaces() java.lang.reflect.Type[]
getGenericSuperclass() java.lang.reflect.Type
getInterfaces() java.lang.Class[]
getMethod(java.lang.String, java.lang.Class[]) java.lang.reflect.Method
getMethods() java.lang.reflect.Method[]
getModifiers() int
getName() java.lang.String
getPackage() java.lang.Package
getProtectionDomain() java.security.ProtectionDomain
getResource(java.lang.String) java.net.URL
getResourceAsStream(java.lang.String) java.io.InputStream
getSigners() java.lang.Object[]
getSimpleName() java.lang.String
getSuperclass() java.lang.Class
getTypeName() java.lang.String
getTypeParameters() java.lang.reflect.TypeVariable[]
isAnnotation() boolean
isAnnotationPresent(java.lang.Class) boolean
isAnonymousClass() boolean
isArray() boolean
isAssignableFrom(java.lang.Class) boolean
isEnum() boolean
isInstance(java.lang.Object) boolean
isInterface() boolean
isLocalClass() boolean
isMemberClass() boolean
isPrimitive() boolean
isSynthetic() boolean
newInstance() java.lang.Object
toGenericString() java.lang.String
toString() java.lang.String
StackTrace coldfusion.runtime.UndefinedElementException: Element STATECODE is undefined in APPLICATION. at coldfusion.runtime.CfJspPage.resolveCanonicalName(CfJspPage.java:1748) at coldfusion.runtime.CfJspPage._resolve(CfJspPage.java:1701) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1850) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1829) at cfApplication2ecfc864992145$funcONAPPLICATIONSTART.runFunction(D:\Websites\States.HomeTownlocator.com\HTDocs\Application.cfc:143) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414) at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:108) at coldfusion.runtime.AppEventInvoker.onApplicationStart(AppEventInvoker.java:231) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:309) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:112) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:58) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:219) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:450) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:197) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
Suppressed
error - array [empty]
TagContext
error - array
1
error - struct
COLUMN 0
ID ??
LINE 143
RAW_TRACE at cfApplication2ecfc864992145$funcONAPPLICATIONSTART.runFunction(D:\Websites\States.HomeTownlocator.com\HTDocs\Application.cfc:143)
TEMPLATE D:\Websites\States.HomeTownlocator.com\HTDocs\Application.cfc
TYPE CFML
Template /index.cfm
Type coldfusion.runtime.CfErrorWrapper
form - struct [empty]
url - struct [empty]
cgi - struct
AUTH_PASSWORD [empty string]
AUTH_TYPE [empty string]
AUTH_USER [empty string]
CERT_COOKIE [empty string]
CERT_FLAGS [empty string]
CERT_ISSUER [empty string]
CERT_KEYSIZE 256
CERT_SECRETKEYSIZE 2048
CERT_SERIALNUMBER [empty string]
CERT_SERVER_ISSUER C=GB, S=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Domain Validation Secure Server CA
CERT_SERVER_SUBJECT OU=Domain Control Validated, OU=EssentialSSL Wildcard, CN=*.htl-test.com
CERT_SUBJECT [empty string]
CF_TEMPLATE_PATH D:\Websites\States.HomeTownlocator.com\HTDocs\index.cfm
CONTENT_LENGTH 0
CONTENT_TYPE [empty string]
CONTEXT_PATH [empty string]
GATEWAY_INTERFACE CGI/1.1
HTTPS on
HTTPS_KEYSIZE 256
HTTPS_SECRETKEYSIZE 2048
HTTPS_SERVER_ISSUER C=GB, S=Greater Manchester, L=Salford, O=COMODO CA Limited, CN=COMODO RSA Domain Validation Secure Server CA
HTTPS_SERVER_SUBJECT OU=Domain Control Validated, OU=EssentialSSL Wildcard, CN=*.htl-test.com
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING x-gzip, gzip, deflate
HTTP_ACCEPT_LANGUAGE [empty string]
HTTP_CONNECTION [empty string]
HTTP_COOKIE [empty string]
HTTP_HOST htl-test.com
HTTP_REFERER [empty string]
HTTP_URL [empty string]
HTTP_USER_AGENT CCBot/2.0 (http://commoncrawl.org/faq/)
LOCAL_ADDR florida.htl-test.com
PATH_INFO /index.cfm
PATH_TRANSLATED D:\Websites\States.HomeTownlocator.com\HTDocs\index.cfm
QUERY_STRING [empty string]
REMOTE_ADDR 192.168.10.8
REMOTE_HOST 192.168.10.8
REMOTE_USER [empty string]
REQUEST_METHOD GET
SCRIPT_NAME /index.cfm
SERVER_NAME htl-test.com
SERVER_PORT 443
SERVER_PORT_SECURE 1
SERVER_PROTOCOL HTTP/1.1
SERVER_SOFTWARE Microsoft-IIS/8.5
WEB_SERVER_API [empty string]