Added more descriptive error messages
This commit is contained in:
parent
7b34c5c9ba
commit
507cf9edd1
@ -285,11 +285,12 @@ class ObservationsController {
|
|||||||
if (::mailer.isInitialized) {
|
if (::mailer.isInitialized) {
|
||||||
val data = getObservations(observationsRequest)
|
val data = getObservations(observationsRequest)
|
||||||
if (data.isEmpty())
|
if (data.isEmpty())
|
||||||
return false
|
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "Request would send no data.")
|
||||||
mailer.sendObservationData(data)
|
mailer.sendObservationData(data)
|
||||||
return true
|
return true
|
||||||
} else
|
} else {
|
||||||
logger.error("Mailer has not been initialized.")
|
logger.error("Mailer has not been initialized.")
|
||||||
return false
|
throw ResponseStatusException(HttpStatus.SERVICE_UNAVAILABLE, "Mail is currently unavailable due to a server configuration error.")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user