X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fyaz4j%2FExceptionUtil.java;h=2309f4301175796d26d60dc00d0414baa9dd0717;hb=2caa42f8fcdbf463e7f8e94a9a9b9c578ffc2926;hp=8eb223b7a7160f98a050717629f0e0486f1b27ab;hpb=95873c80a22cbcb609b5a0260d624359500dcf19;p=yaz4j-moved-to-github.git diff --git a/src/main/java/org/yaz4j/ExceptionUtil.java b/src/main/java/org/yaz4j/ExceptionUtil.java index 8eb223b..2309f43 100644 --- a/src/main/java/org/yaz4j/ExceptionUtil.java +++ b/src/main/java/org/yaz4j/ExceptionUtil.java @@ -16,7 +16,8 @@ import org.yaz4j.jni.yaz4jlibConstants; */ class ExceptionUtil { - static ZoomException getError(SWIGTYPE_p_ZOOM_connection_p zoomConnection, String host, int port) { + static ZoomException getError(SWIGTYPE_p_ZOOM_connection_p zoomConnection, + String host, int port) { int errorCode = yaz4jlib.ZOOM_connection_errcode(zoomConnection); String message; switch (errorCode) { @@ -24,19 +25,19 @@ class ExceptionUtil { return null; case yaz4jlib.ZOOM_ERROR_CONNECT: message = String.format("Connection could not be made to %s:%d", host, - port); + port); return new ConnectionUnavailableException(message); case yaz4jlib.ZOOM_ERROR_INVALID_QUERY: message = String.format( - "The query requested is not valid or not supported"); + "The query requested is not valid or not supported"); return new InvalidQueryException(message); case yaz4jlib.ZOOM_ERROR_INIT: message = String.format("Server %s:%d rejected our init request", host, - port); + port); return new InitRejectedException(message); case yaz4jlib.ZOOM_ERROR_TIMEOUT: message = String.format("Server %s:%d timed out handling our request", - host, port); + host, port); return new ConnectionTimeoutException(message); case yaz4jlib.ZOOM_ERROR_MEMORY: case yaz4jlib.ZOOM_ERROR_ENCODE: @@ -46,13 +47,12 @@ class ExceptionUtil { case yaz4jlib.ZOOM_ERROR_UNSUPPORTED_PROTOCOL: case yaz4jlib.ZOOM_ERROR_UNSUPPORTED_QUERY: message = yaz4jlib.ZOOM_connection_errmsg(zoomConnection); - return new ZoomImplementationException("A fatal error occurred in Yaz: " + - errorCode + " - " + message); + return new ZoomImplementationException("A fatal error occurred in Yaz: " + + errorCode + " - " + message); default: - String errMsgBib1 = "Bib1Exception: Error Code = " + errorCode + " (" + - Bib1Diagnostic.getError(errorCode) + ")"; + String errMsgBib1 = "Bib1Exception: Error Code = " + errorCode + " (" + Bib1Diagnostic. + getError(errorCode) + ")"; return new Bib1Exception(errMsgBib1); } } - -} \ No newline at end of file +}