Skip to content
Snippets Groups Projects
Commit 5474e68a authored by OZGCloud's avatar OZGCloud
Browse files

Log errors if thrown in processing

parent 07381ae5
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@
*/
package de.itvsh.kop.eingangsadapter.formsolutions;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
......@@ -31,8 +32,10 @@ import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
import de.itvsh.kop.eingangsadapter.common.formdata.FormData;
import de.itvsh.kop.eingangsadapter.semantik.SemantikAdapter;
import lombok.extern.log4j.Log4j2;
@Endpoint
@Log4j2
public class SendFormEndpoint {
public static final String JSON_FIELD = "json";
@Autowired
......@@ -43,9 +46,14 @@ public class SendFormEndpoint {
@PayloadRoot(namespace = WebServiceConfiguration.NAMESPACE_URI, localPart = "Request")
@ResponsePayload
public Response receiveForm(@RequestPayload Request request) {
semantikAdapter.processFormData(parseRequestData(request.getJSON()));
try {
semantikAdapter.processFormData(parseRequestData(request.getJSON()));
return buildSuccessResponse();
} catch (Exception e) {
LOG.error("Error on processing FS Formdata.", e);
return ExceptionUtils.rethrow(e);
}
return buildSuccessResponse();
}
FormData parseRequestData(String json) {
......@@ -58,4 +66,5 @@ public class SendFormEndpoint {
response.setStatus("OK");
return response;
}
}
logging:
level:
ROOT: WARN
'[de.itvsh]': INFO
server:
port: 8080
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment