From 54f16e552a3d6c5579282de5c8d6a92395f6c049 Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Sat, 13 May 2023 15:18:03 +0200 Subject: refact(core): remove double serialization in central error handling --- .../eaaf/core/impl/idp/controller/AbstractController.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java') diff --git a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java index b05d8df0..4fa2676d 100644 --- a/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java +++ b/eaaf_core/src/main/java/at/gv/egiz/eaaf/core/impl/idp/controller/AbstractController.java @@ -30,7 +30,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationContext; -import org.springframework.util.SerializationUtils; import org.springframework.web.bind.annotation.ExceptionHandler; import at.gv.egiz.components.eventlog.api.EventConstants; @@ -178,21 +177,13 @@ public abstract class AbstractController { if (errorToHandle.getFirst() != null) { revisionsLogger.logEvent(errorToHandle.getFirst(), EventConstants.TRANSACTION_ERROR); - - log.trace("Serializing {} ... ", ExceptionContainer.class.getName()); - final byte[] serializedError = SerializationUtils.serialize( - new ExceptionContainer(errorToHandle.getFirst(), errorToHandle.getSecond())); - log.debug("Put 'ExceptionContainer' into cache with id: {}... ", errorKey); - transactionStorage.put(errorKey, serializedError, -1); + transactionStorage.put(errorKey, + new ExceptionContainer(errorToHandle.getFirst(), errorToHandle.getSecond()), -1); } else { - log.trace("Serializing {} ... ", ExceptionContainer.class.getName()); - final byte[] serializedError = SerializationUtils.serialize( - new ExceptionContainer(null, errorToHandle.getSecond())); - log.trace("Put 'ExceptionContainer' into cache with id: {}... ",errorKey); - transactionStorage.put(errorKey, serializedError, -1); + transactionStorage.put(errorKey, new ExceptionContainer(null, errorToHandle.getSecond()), -1); } -- cgit v1.2.3