Physical spec save message
#CTCTOWALTZ-1512
@@ -27,6 +27,7 @@ import com.khartec.waltz.service.settings.SettingsService;
import com.khartec.waltz.web.endpoints.Endpoint;
import com.khartec.waltz.web.endpoints.api.StaticResourcesEndpoint;
import com.khartec.waltz.web.endpoints.extracts.BaseDataExtractor;
+import org.jooq.exception.DataAccessException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@@ -152,6 +153,18 @@ public class Main {
reportException(403, "NOT_AUTHORIZED", e.getMessage(), resp, LOG));
+ exception(DataAccessException.class, (e, req, resp) -> {
+ String message = "Exception: " + e.getCause().getMessage();
+ LOG.error(message, e);
+ reportException(
+ 500,
+ e.sqlState(),
+ message,
+ resp,
+ LOG);
+ });
+
+
exception(Exception.class, (e, req, res) -> {
String message = "Exception: " + e.getMessage() + " / " + e.getClass().getCanonicalName();
LOG.error(message, e);
