diff --git a/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/controller/ObservationsController.kt b/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/controller/ObservationsController.kt index 5947153..b14f711 100644 --- a/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/controller/ObservationsController.kt +++ b/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/controller/ObservationsController.kt @@ -285,8 +285,10 @@ class ObservationsController { logger.info("Sending Observation data by email") if (::mailer.isInitialized) { val data = getObservations(observationsRequest) - if (data.isEmpty()) + if (data.isEmpty()) { + logger.warn("Email not send, would contain no data") throw ResponseStatusException(HttpStatus.BAD_REQUEST, "Request would send no data.") + } mailer.sendObservationData(data) return true } else {