Skip to content

Commit

Permalink
IM-283 Increase error logging in Geoserver interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
iperdomo committed Feb 16, 2024
1 parent d7caa6e commit 8985387
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,14 @@ public boolean createCoverageStore(String namespace, String name, File file) {
request = request.basicAuth(username, password);
}

return request.body(payload).asEmpty().isSuccess();
HttpResponse<String> resp = request.body(payload).asString();
if (!resp.isSuccess()) {
Logging.INSTANCE.error("Error creating coverage store: HTTP [" + resp.getStatus() + "] - " + resp.getBody());
}
return resp.isSuccess();

} catch (MalformedURLException e) {
// TODO Auto-generated catch block
Logging.INSTANCE.error("Error creating coverage store - ", e.getMessage());
}

return false;
Expand Down Expand Up @@ -231,8 +235,11 @@ public boolean createCoverageLayer(String namespace, String name, File file, @Nu
request = request.basicAuth(username, password);
}

return request.body(payload).asEmpty().isSuccess();

HttpResponse<String> resp = request.body(payload).asString();
if (!resp.isSuccess()) {
Logging.INSTANCE.error("Error creating coverage layer: HTTP [" + resp.getStatus() + "] - " + resp.getBody());
}
return resp.isSuccess();
}
return false;
}
Expand Down

0 comments on commit 8985387

Please sign in to comment.