Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit c97542e

Browse files
committed
#38 Don't need to wrap the error, and added some debug logging
1 parent a1de05f commit c97542e

File tree

3 files changed

+17
-24
lines changed

3 files changed

+17
-24
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
group=com.marklogic
22
javadocsDir=../gh-pages-marklogic-java/javadocs
3-
version=2.11.0-dev
3+
version=2.11.0

src/main/java/com/marklogic/client/modulesloader/impl/AbstractStaticChecker.java

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,13 @@ public void checkLoadedAssets(List<LoadedAsset> assets) {
3838
* @param uri
3939
*/
4040
protected void staticallyCheckModule(String uri) {
41-
try {
42-
if (logger.isInfoEnabled()) {
43-
logger.info("Performing static check on module at URI: " + uri);
44-
}
45-
String xquery = "let $uri := '" + uri + "' return " + buildXqueryForStaticallyCheckingModule();
46-
executeQuery(xquery);
47-
if (logger.isInfoEnabled()) {
48-
logger.info("Finished static check on module at URI: " + uri);
49-
}
50-
} catch (Exception re) {
51-
String message = "Static check failed for module at URI: " + uri + "; cause: " + re.getMessage();
52-
throw new RuntimeException(message, re);
41+
if (logger.isInfoEnabled()) {
42+
logger.info("Performing static check on module at URI: " + uri);
43+
}
44+
String xquery = "let $uri := '" + uri + "' return " + buildXqueryForStaticallyCheckingModule();
45+
executeQuery(xquery);
46+
if (logger.isInfoEnabled()) {
47+
logger.info("Finished static check on module at URI: " + uri);
5348
}
5449
}
5550

@@ -66,17 +61,12 @@ protected void performBulkStaticCheck(List<LoadedAsset> assets) {
6661
}
6762
xquery += ") for $uri in $uris return " + buildXqueryForStaticallyCheckingModule();
6863

69-
try {
70-
if (logger.isInfoEnabled()) {
71-
logger.info("Static checking all loaded modules");
72-
}
73-
executeQuery(xquery);
74-
if (logger.isInfoEnabled()) {
75-
logger.info("Finished static checking all loaded modules");
76-
}
77-
} catch (Exception re) {
78-
String message = "Bulk static check failure, cause: " + re.getMessage();
79-
throw new RuntimeException(message, re);
64+
if (logger.isInfoEnabled()) {
65+
logger.info("Static checking all loaded modules");
66+
}
67+
executeQuery(xquery);
68+
if (logger.isInfoEnabled()) {
69+
logger.info("Finished static checking all loaded modules");
8070
}
8171
}
8272

src/main/java/com/marklogic/client/modulesloader/impl/XccStaticChecker.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ public XccStaticChecker(XccTemplate xccTemplate) {
1717

1818
@Override
1919
protected void executeQuery(String xquery) {
20+
if (logger.isDebugEnabled()) {
21+
logger.debug(xquery);
22+
}
2023
xccTemplate.executeAdhocQuery(xquery);
2124
}
2225
}

0 commit comments

Comments
 (0)