Skip to content

Commit c443cfb

Browse files
authored
Merge pull request #1924 from lat-lon/fix/improvedErrorHandlingConsole-870
Improved logging in case of errors in deegree admin console
2 parents f04af9d + 4b42804 commit c443cfb

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

deegree-services/deegree-webservices/src/main/java/org/deegree/console/metadata/ResourceManagerMetadata.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ public class ResourceManagerMetadata implements Comparable<ResourceManagerMetada
7373
private final Workspace workspace;
7474

7575
private ResourceManagerMetadata(ResourceManager<?> mgr, Workspace workspace) {
76+
if (mgr == null)
77+
throw new IllegalArgumentException(
78+
"ResourceManager must not be null. Check your workspace configuration for errors.");
7679
this.workspace = workspace;
7780
if (mgr.getMetadata() != null) {
7881
for (ResourceProvider<?> provider : mgr.getProviders()) {

deegree-services/deegree-webservices/src/main/java/org/deegree/console/workspace/WorkspaceBean.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public String applyChanges() {
217217
OGCFrontController.getInstance().reload();
218218
}
219219
catch (Exception e) {
220-
e.printStackTrace();
220+
LOG.error("Failed to reload OGCFrontController {} ", e.getMessage(), e);
221221
}
222222

223223
modified = false;
@@ -240,6 +240,7 @@ public void downloadWorkspace() {
240240
importWorkspace(location);
241241
}
242242
catch (Throwable t) {
243+
LOG.error("Failed to download workspace {} ", t.getMessage(), t);
243244
FacesMessage fm = new FacesMessage(SEVERITY_ERROR, "Unable to download workspace: " + t.getMessage(), null);
244245
FacesContext.getCurrentInstance().addMessage(null, fm);
245246
}
@@ -274,7 +275,7 @@ private void importWorkspace(String location) {
274275
}
275276
}
276277
catch (Exception e) {
277-
e.printStackTrace();
278+
LOG.error("Failed to import workspace {} ", e.getMessage(), e);
278279
FacesMessage fm = new FacesMessage(SEVERITY_ERROR, "Unable to import workspace: " + e.getMessage(), null);
279280
FacesContext.getCurrentInstance().addMessage(null, fm);
280281
}
@@ -363,7 +364,7 @@ public List<String> downloadWorkspaceList(String url) {
363364
return res;
364365
}
365366
catch (Throwable t) {
366-
LOG.warn("Could not get workspace list: {}.", t.getMessage());
367+
LOG.error("Could not get workspace list: {}.", t.getMessage());
367368
return new ArrayList<String>();
368369
}
369370
finally {

0 commit comments

Comments
 (0)