aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Kehrer <felix.kehrer@gmail.com>2018-06-14 21:23:32 +0200
committerTharre <tharre3@gmail.com>2018-06-16 17:37:48 +0200
commitdc6f5a0fdd481fe6934c6aebe3636060582fb8bc (patch)
treea892c646938e92f31a661ff9acede9a4e95cbddf
parent0a5113970030210c7fbb66f47df9b85caead7a60 (diff)
downloadsepm-groupproject-dc6f5a0fdd481fe6934c6aebe3636060582fb8bc.tar.gz
sepm-groupproject-dc6f5a0fdd481fe6934c6aebe3636060582fb8bc.tar.xz
sepm-groupproject-dc6f5a0fdd481fe6934c6aebe3636060582fb8bc.zip
Remove all occurrences of "log and rethrow" #27033
-rw-r--r--src/main/java/at/ac/tuwien/sepm/assignment/groupphase/einsatzverwaltung/service/OperationServiceImpl.java17
1 files changed, 0 insertions, 17 deletions
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 4c71414..497c6bc 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
@@ -85,14 +85,11 @@ public class OperationServiceImpl implements OperationService {
.status(Status.ACTIVE)
.build());
} catch (PersistenceException e) {
- LOG.error("PersistenceException while adding Operation. Message: {}", e.getMessage());
throw new ServiceException(e);
} catch (InvalidVehicleException e) {
// already logged as invalid vehicle
throw new InvalidOperationException("Enthaltenes Fahrzeug ist ungültig", e);
} catch (ElementNotFoundException e) {
- LOG.error(
- "ElementNotFoundException while adding Operation. Message: {}", e.getMessage());
throw new InvalidOperationException("Enthaltenes Fahrzeug existiert nicht", e);
}
}
@@ -142,7 +139,6 @@ public class OperationServiceImpl implements OperationService {
vs.add(v);
} catch (ElementNotFoundException e) {
- LOG.info("Invalid Vehicle: VehicleId is not valid");
throw new InvalidVehicleException("VehicleId ist invalid");
}
}
@@ -152,13 +148,8 @@ public class OperationServiceImpl implements OperationService {
operationDAO.update(o.toBuilder().vehicles(vs).build());
} catch (ElementNotFoundException e) {
- LOG.error(
- "ElementNotFoundException while requesting Vehicles. Message: {}",
- e.getMessage());
throw new InvalidOperationException("Kein Einsatz mit dieser ID existiert");
} catch (PersistenceException e) {
- LOG.error(
- "PersistenceException while requesting vehicles. Message: {}", e.getMessage());
throw new ServiceException(e);
}
}
@@ -170,13 +161,8 @@ public class OperationServiceImpl implements OperationService {
Operation o = operationDAO.get(operationId);
operationDAO.update(o.toBuilder().status(status).build());
} catch (ElementNotFoundException e) {
- LOG.error(
- "ElementNotFoundException while completing operation. Message: {}",
- e.getMessage());
throw new InvalidOperationException(e);
} catch (PersistenceException e) {
- LOG.error(
- "PersistenceException while completing operation. Message: {}", e.getMessage());
throw new ServiceException(e);
}
}
@@ -251,11 +237,9 @@ public class OperationServiceImpl implements OperationService {
return operations;
} catch (PersistenceException e) {
- LOG.error("PersistenceException while listing operations. Message: {}", e);
throw new ServiceException(e);
} catch (InvalidOperationException e) {
// database returned invalid values
- LOG.error("DB returned invalid operation. Message: {}", e.getMessage());
throw new ServiceException("DB returned invalid operation", e);
}
}
@@ -271,7 +255,6 @@ public class OperationServiceImpl implements OperationService {
try {
VehicleServiceImpl.validateVehicle(v);
} catch (InvalidVehicleException e) {
- LOG.info("Invalid Operation: Vehicle \"{}\" is invalid", v.name());
throw new InvalidOperationException("Fahrzeug " + v.name() + " ist invalid" + e);
}