You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ukanga
changed the title
Prevent API from returning url : false if submission edit enketo url is not provided
API is returning enketo url with the value 'false' on some edits
Aug 3, 2017
This happened because we were posting a too large body to Enketo than what it was configured to receive. In this case, we need to handle HTTP status codes >= 400 and return an appropriate error message to the user.
Fixes: #1072
We discovored that the API endpoint to get an enketo edit url
encountered >400 level errors it did not properly set the HTTP
status code and instead returned the edit url as false.
This set of commits fixes that by raising an EnketoError exception
which has a friendly default error message that can be overriden.
* Ensure that >400 level HTTP errors are properly handled
Fixes: #1072
We discovored that the API endpoint to get an enketo edit url
encountered >400 level errors it did not properly set the HTTP
status code and instead returned the edit url as false.
This set of commits fixes that by raising an EnketoError exception
which has a friendly default error message that can be overriden.
* Move EnketoError exception to onadata.libs.exceptions.py
Moved this exception here for consistency..
* Report errors caught while trying to get enketo edit url
These are mostly 400 level errors. We ask the user to contact support
and so keeping a record of the errors encountered is a good idea, for
referencing.
In the spirit of DRY, we merged the duplicated report_exception functions
in logger_tools and viewer_tools and moved it to common_tools.
API Endpoint: /data/[pk]/[dataid]/enketo
Expected:
Return status 400 with an appropriate failure message if a submission edit URL is not present.
Aha! Link: https://ona.aha.io/features/PROD-542
The text was updated successfully, but these errors were encountered: