Marijan Milicevic pushed to branch feature/ESSENTIALS-1046 at cms-community /
hippo-essentials
Commits:
714672bd by Marijan Milicevic at 2017-02-10T12:32:20+01:00
ESSENTIALS-1046 Improve handling of missing project.basedir property
- log error messages without stacktrace (stacktrace logged only in debug mode)
- - - - -
2 changed files:
-
dashboard/src/main/java/org/onehippo/cms7/essentials/filters/RequirementsCheckFilter.java
-
plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/utils/ProjectUtils.java
Changes:
=
dashboard/src/main/java/org/onehippo/cms7/essentials/filters/RequirementsCheckFilter.java
=
---
a/dashboard/src/main/java/org/onehippo/cms7/essentials/filters/RequirementsCheckFilter.java
+++
b/dashboard/src/main/java/org/onehippo/cms7/essentials/filters/RequirementsCheckFilter.java
@@ -52,11 +52,13 @@ public class RequirementsCheckFilter implements Filter {
return;
}
if (!file.isDirectory()) {
-sendRedirect(req, res, "Directory: " + directory + " must be a
directory");
+sendRedirect(req, res, "File: " + directory + " must be a
directory");
return;
}
} catch (IllegalStateException e) {
-log.error("Error processing req", e);
+if (log.isDebugEnabled()) {
+log.error("Error processing request:", e);
+}
sendRedirect(req, res, e.getMessage());
return;
}
@@ -65,6 +67,7 @@ public class RequirementsCheckFilter implements Filter {
private void sendRedirect(final ServletRequest req, final ServletResponse
resp, final String error) throws IOException {
final HttpServletResponse response = (HttpServletResponse) resp;
+log.error(error);
req.setAttribute("error", error);
response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE, error);
}
=
plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/utils/ProjectUtils.java
=
---
a/plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/utils/ProjectUtils.java
+++
b/plugin-sdk/implementation/src/main/java/org/onehippo/cms7/essentials/dashboard/utils/ProjectUtils.java
@@ -116,7 +116,7 @@ public final class ProjectUtils {
if (System.getProperty(EssentialConst.PROJECT_BASEDIR_PROPERTY) !=
null && !System.getProperty(EssentialConst.PROJECT_BASEDIR_PROPERTY).isEmpty())
{
return System.getProperty(EssentialConst.PROJECT_BASEDIR_PROPERTY);
}
-throw new IllegalStateException("System property 'project.basedir' was
not null or empty. Please start your application with
-D=project.basedir=/project/path");
+throw new IllegalStateException("System property 'project.basedir' was
null or empty. Please start your application with
-D=project.basedir=/project/path");
}
public static String getEssentialsModuleName() {
View it on GitLab:
https://code.onehippo.org/cms-community/hippo-essentials/commit/714672bd9161fd6cdd545c810b4f2c6b4f71939a
___
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn