- Improve email notification cases for unexpected exceptions.
This commit is contained in:
@@ -58,7 +58,7 @@ mail.serverSendEmail=root@localhost
|
||||
mail.supportEmail=root@localhost
|
||||
|
||||
# Optional: Unexpected errors will be reported to this address.
|
||||
mail.errorReporterEmail=
|
||||
mail.errorReporterEmail=support@wisemapping.com
|
||||
|
||||
##################################################################################
|
||||
# Users Registration Configuration
|
||||
|
@@ -50,11 +50,25 @@
|
||||
<definition name="unexpectedError" extends="errorTemplate">
|
||||
<put-attribute name="title" value="UNEXPECTED_ERROR"/>
|
||||
<put-attribute name="details" value="UNEXPECTED_ERROR_DETAILS"/>
|
||||
<put-attribute name="logError" value="true"/>
|
||||
</definition>
|
||||
|
||||
<definition name="securityError" extends="errorTemplate">
|
||||
<put-attribute name="title" value="NO_ENOUGH_PERMISSIONS"/>
|
||||
<put-attribute name="details" value="NO_ENOUGH_PERMISSIONS_DETAILS"/>
|
||||
<put-attribute name="logError" value="false"/>
|
||||
</definition>
|
||||
|
||||
<definition name="forgotPasswordError" extends="errorTemplate">
|
||||
<put-attribute name="title" value="INVALID_EMAIL_ERROR"/>
|
||||
<put-attribute name="body" value="/jsp/userForgotPasswordError.jsp"/>
|
||||
<put-attribute name="logError" value="false"/>
|
||||
</definition>
|
||||
|
||||
<definition name="forgotPasswordSuccess" extends="errorTemplate">
|
||||
<put-attribute name="title" value="FORGOT_PASSWORD"/>
|
||||
<put-attribute name="body" value="/jsp/userForgotPasswordSuccess.jsp"/>
|
||||
<put-attribute name="logError" value="false"/>
|
||||
</definition>
|
||||
|
||||
<!-- Main Pages -->
|
||||
@@ -68,16 +82,6 @@
|
||||
<put-attribute name="body" value="/jsp/termsOfUse.jsp"/>
|
||||
</definition>
|
||||
|
||||
<definition name="forgotPasswordError" extends="errorTemplate">
|
||||
<put-attribute name="title" value="INVALID_EMAIL_ERROR"/>
|
||||
<put-attribute name="body" value="/jsp/userForgotPasswordError.jsp"/>
|
||||
</definition>
|
||||
|
||||
<definition name="forgotPasswordSuccess" extends="errorTemplate">
|
||||
<put-attribute name="title" value="FORGOT_PASSWORD"/>
|
||||
<put-attribute name="body" value="/jsp/userForgotPasswordSuccess.jsp"/>
|
||||
</definition>
|
||||
|
||||
<definition name="forgotPassword" extends="pageTemplate">
|
||||
<put-attribute name="title" value="FORGOT_PASSWORD"/>
|
||||
<put-attribute name="body" value="/jsp/userForgotPassword.jsp"/>
|
||||
|
@@ -54,7 +54,7 @@
|
||||
|
||||
|
||||
<bean id="exceptionHandlerResolver"
|
||||
class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
|
||||
class="com.wisemapping.mail.NotifyingExceptionResolver">
|
||||
<property name="defaultStatusCode" value="500"/>
|
||||
<property name="defaultErrorView" value="unexpectedError"/>
|
||||
<property name="exceptionMappings">
|
||||
@@ -65,6 +65,14 @@
|
||||
<prop key="java.lang.reflect.UndeclaredThrowableException">securityError</prop>
|
||||
</props>
|
||||
</property>
|
||||
<property name="exclude">
|
||||
<set>
|
||||
<value>java.lang.reflect.UndeclaredThrowableException</value>
|
||||
<value>com.wisemapping.exceptions.GoogleChromeFrameRequiredException</value>
|
||||
<value>com.wisemapping.exceptions.UnsupportedBrowserException</value>
|
||||
</set>
|
||||
</property>
|
||||
<property name="notificationService" ref="notificationService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
|
||||
|
@@ -1,14 +1,8 @@
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
<%@ page import="org.apache.log4j.Logger" %>
|
||||
<%@ page import="com.wisemapping.security.Utils" %>
|
||||
<%@ page import="com.wisemapping.model.User" %>
|
||||
<%@ page autoFlush="true" buffer="none" %>
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
|
||||
<%!
|
||||
final Logger logger = Logger.getLogger("com.wisemapping");
|
||||
%>
|
||||
<h2>
|
||||
<spring:message code="${requestScope.title}"/>
|
||||
</h2>
|
||||
@@ -16,21 +10,4 @@
|
||||
<strong>
|
||||
<spring:message code="${requestScope.details}"/>
|
||||
</strong>
|
||||
<!--
|
||||
<%
|
||||
final Throwable exception = (Throwable) request.getAttribute("exception");
|
||||
if (exception != null) {
|
||||
exception.printStackTrace(response.getWriter());
|
||||
String usrMail = "anonymous";
|
||||
final User user = Utils.getUser(false);
|
||||
if (user != null) {
|
||||
usrMail = user.getEmail();
|
||||
}
|
||||
|
||||
logger.error("Unexpected error on user '" + usrMail + " ':", exception);
|
||||
|
||||
}
|
||||
%>
|
||||
|
||||
-->
|
||||
|
||||
|
Reference in New Issue
Block a user