diff options
author | tkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2012-10-02 19:40:16 +0000 |
---|---|---|
committer | tkellner <tkellner@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2012-10-02 19:40:16 +0000 |
commit | 32a55fe960a609e0d4f25e408d1f56e2204f02db (patch) | |
tree | 1661069a16a46f74266e1068c701cad7661fbe34 /smccSTAL/src/main | |
parent | 6053457f2c36be893cacbd74f2b173d149f9efd1 (diff) | |
download | mocca-32a55fe960a609e0d4f25e408d1f56e2204f02db.tar.gz mocca-32a55fe960a609e0d4f25e408d1f56e2204f02db.tar.bz2 mocca-32a55fe960a609e0d4f25e408d1f56e2204f02db.zip |
set / log errormessages in some remaining places
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1144 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'smccSTAL/src/main')
-rw-r--r-- | smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java index 830ec8cb..1374e890 100644 --- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java +++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java @@ -80,7 +80,9 @@ public abstract class AbstractSMCCSTAL implements STAL { if (handler != null) { if (handler.requireCard()) { if (waitForCard()) { - return new ErrorResponse(6001); + ErrorResponse err = new ErrorResponse(6001); + err.setErrorMessage("Cancel while waiting for card"); + return err; } } try { @@ -88,8 +90,8 @@ public abstract class AbstractSMCCSTAL implements STAL { STALResponse response = handler.handleRequest(request); if (response != null) { if (response instanceof ErrorResponse) { - log.info("Got an error response."); ErrorResponse err = (ErrorResponse) response; + log.info("Got an error response: " + err.getErrorMessage()); if (unrecoverableErrors.contains(err.getErrorCode())) { return response; } @@ -118,15 +120,21 @@ public abstract class AbstractSMCCSTAL implements STAL { signatureCard = null; } else { log.info("Exceeded max retries, returning error."); - return new ErrorResponse(6000); + ErrorResponse err = new ErrorResponse(6000); + err.setErrorMessage("Exceeded max retries trying to read STAL response"); + return err; } } } else { log.error("Cannot find a handler for STAL request: {}.", request); - return new ErrorResponse(); + ErrorResponse err = new ErrorResponse(); + err.setErrorMessage("Cannot find a handler for STAL request: " + request); + return err; } } - return new ErrorResponse(6000); + ErrorResponse err = new ErrorResponse(6000); + err.setErrorMessage("Exceeded max retries trying to read STAL response"); + return err; } /** @@ -148,7 +156,8 @@ public abstract class AbstractSMCCSTAL implements STAL { if (response != null) { responseList.add(response); if (response instanceof ErrorResponse) { - log.info("Got an error response, don't process remaining requests."); + ErrorResponse err = (ErrorResponse)response; + log.info("Got an error response, don't process remaining requests: " + err.getErrorMessage()); break; } } |