summaryrefslogtreecommitdiff
path: root/bkucommon/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'bkucommon/src/main')
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignatureException.java14
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignatureMethod.java3
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/Signature.java9
3 files changed, 20 insertions, 6 deletions
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignatureException.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignatureException.java
index 91cfde5d..aa126744 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignatureException.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignatureException.java
@@ -52,10 +52,22 @@ public class STALSignatureException extends SignatureException {
*
* @param errorCode the error code
*/
- public STALSignatureException(int errorCode) {
+ public STALSignatureException(int errorCode) {
+ super();
this.errorCode = errorCode;
}
+ /**
+ * Creates a new instance of this STALSigantureException with
+ * the given <code>errorCode</code>.
+ *
+ * @param errorCode the error code
+ */
+ public STALSignatureException(int errorCode, String msg) {
+ super(msg);
+ this.errorCode = errorCode;
+ }
+
/**
* Creates a new instance of this STALSignatureException with
* the given error <code>msg</code>.
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignatureMethod.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignatureMethod.java
index 44f49031..51c6c805 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignatureMethod.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/STALSignatureMethod.java
@@ -113,7 +113,8 @@ public class STALSignatureMethod extends AbstractSignatureMethodImpl {
if (response instanceof SignResponse) {
return ((SignResponse) response).getSignatureValue();
} else if (response instanceof ErrorResponse) {
- STALSignatureException se = new STALSignatureException(((ErrorResponse) response).getErrorCode());
+ ErrorResponse err = (ErrorResponse) response;
+ STALSignatureException se = new STALSignatureException(err.getErrorCode(), err.getErrorMessage());
throw new XMLSignatureException(se);
} else {
throw new XMLSignatureException("Failed to access STAL.");
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/Signature.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/Signature.java
index e7f04457..8cc6caf2 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/Signature.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/Signature.java
@@ -434,12 +434,13 @@ public class Signature {
Throwable cause = e.getCause();
while (cause != null) {
if (cause instanceof STALSignatureException) {
- if (((STALSignatureException) cause).getCause() instanceof SLViewerException) {
- throw (SLViewerException) ((STALSignatureException) cause).getCause();
+ STALSignatureException stalCause = (STALSignatureException) cause;
+ if (stalCause.getCause() instanceof SLViewerException) {
+ throw (SLViewerException) stalCause.getCause();
}
- int errorCode = ((STALSignatureException) cause).getErrorCode();
+ int errorCode = stalCause.getErrorCode();
SLCommandException commandException = new SLCommandException(errorCode);
- log.info("Failed to sign signature.", e);
+ log.info("Failed to sign signature: {}", stalCause.getMessage(), e);
throw commandException;
} else {
cause = cause.getCause();