akvo / akvo-flow

A data collection and monitoring tool that works anywhere.
http://akvo.org/products/akvoflow/
GNU Affero General Public License v3.0
65 stars 31 forks source link

Handle ImageUpload errors properly #3843

Closed valllllll2000 closed 3 years ago

valllllll2000 commented 3 years ago

Context

see https://github.com/akvo/akvo-flow/blob/master/GAE/src/org/akvo/flow/rest/ImageUploadRestService.java#L185 The errors are not handled properly, we could use SpringResponseStatusException The way the service is done right now, for the client it is not easy to know if the request succeeded or not Client should be updated accordingly

muloem commented 3 years ago

The client is actually just waiting for this to be implemented. It already handles based on the returned status and not based on the contents of the response object.

https://github.com/akvo/akvo-flow-services/blob/d5eaba6f88d4cc3fb58def0baa13ce68df20e45b/backend/src/akvo/flow_services/uploader.clj#L280