From 247b0bf9f2b5f503d6bd494df7c4c18db5ead7e4 Mon Sep 17 00:00:00 2001
From: Felix Kehrer <felix.kehrer@gmail.com>
Date: Fri, 25 May 2018 21:55:39 +0200
Subject: changed InvalidXExceptions to return a valid german message #27033

---
 .../service/OperationServiceImpl.java                | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

(limited to 'src/main/java')

diff --git a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/OperationServiceImpl.java b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/OperationServiceImpl.java
index 3c3b91c..853e499 100644
--- a/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/OperationServiceImpl.java
+++ b/src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/OperationServiceImpl.java
@@ -50,17 +50,17 @@ public class OperationServiceImpl implements OperationService {
     public long add(Operation o) throws InvalidOperationException, ServiceException {
         if (o.created() != null) {
             LOG.info("Invalid Operation: Created must be null");
-            throw new InvalidOperationException("Created must not be set");
+            throw new InvalidOperationException("Erstellungszeitpunkt darf nicht gesetzt sein");
         }
 
         if (o.severity() != null) {
             LOG.info("Invalid Operation: Severity must be null");
-            throw new InvalidOperationException("Severity must not be set");
+            throw new InvalidOperationException("Der Schweregrad darf nicht gesetzt sein");
         }
 
         if (o.id() != 0) {
             LOG.info("Invalid Operation: OperationId must be 0");
-            throw new InvalidOperationException("Id must be 0");
+            throw new InvalidOperationException("Einsatz-ID muss 0 sein");
         }
 
         if (o.status() != Status.ACTIVE)
@@ -85,7 +85,7 @@ public class OperationServiceImpl implements OperationService {
             throw new ServiceException(e);
         } catch (InvalidVehicleException e) {
             // already logged as invalid vehicle
-            throw new InvalidOperationException("Enthaltenes Fahrzeug ist invalid", e);
+            throw new InvalidOperationException("Enthaltenes Fahrzeug ist ungültig", e);
         } catch (ElementNotFoundException e) {
             LOG.error(
                     "ElementNotFoundException while adding Operation. Message: {}", e.getMessage());
@@ -101,7 +101,7 @@ public class OperationServiceImpl implements OperationService {
         try {
             if (operationId <= 0) {
                 LOG.info("Invalid Operation: OperationId is invalid (<= 0)");
-                throw new InvalidOperationException("OperationId ist invalid");
+                throw new InvalidOperationException("Einsatz-ID ist ungültig");
             }
             Operation o = operationDAO.get(operationId);
             validateOperation(o);
@@ -109,23 +109,23 @@ public class OperationServiceImpl implements OperationService {
             if (o.opCode().trim().isEmpty()
                     || extractSeverityFromOpCode(o.opCode()) != o.severity()) {
                 LOG.info("Invalid Operation: OpCode does not match Severity");
-                throw new InvalidOperationException("Einsatzcode ist invalid");
+                throw new InvalidOperationException("Einsatzcode ist ungültig");
             }
 
             if (o.status() != Status.ACTIVE) {
                 LOG.info("Invalid Operation: Operation is not active");
-                throw new InvalidOperationException("Einsatz ist inaktiv");
+                throw new InvalidOperationException("Einsatz ist ungültig");
             }
 
             if (o.created() == null) {
                 LOG.info("Invalid Operation: Created field is null");
-                throw new InvalidOperationException("Created darf nicht leer sein");
+                throw new InvalidOperationException("Erstellungszeitpunkt darf nicht leer sein");
             }
 
             for (Long id : vehicleIds) {
                 if (id <= 0) {
                     LOG.info("Invalid Vehicle: VehicleId is not valid");
-                    throw new InvalidVehicleException("VehicleId ist invalid");
+                    throw new InvalidVehicleException("Fahrzeug-ID ist ungültig");
                 }
 
                 try {
@@ -152,7 +152,7 @@ public class OperationServiceImpl implements OperationService {
             LOG.error(
                     "ElementNotFoundException while requesting Vehicles. Message: {}",
                     e.getMessage());
-            throw new InvalidOperationException("Kein Einsatz mit dieser id existiert");
+            throw new InvalidOperationException("Kein Einsatz mit dieser ID existiert");
         } catch (PersistenceException e) {
             LOG.error(
                     "PersistenceException while requesting vehicles. Message: {}", e.getMessage());
-- 
cgit v1.2.3-70-g09d2