pacificclimate / scip-backend

Backend that serves salmon population data to the scip webpage
GNU Affero General Public License v3.0
0 stars 0 forks source link

More specific error messages when the API returns no data #2

Open corviday opened 1 year ago

corviday commented 1 year ago

@jameshiebert suggests returning a 404 instead of a blank list when a request is made to the regions API for which there are no qualifying regions, and perhaps text indicating why there are no qualifying regions (such as being outside the domain).

Similarly, there might be ways to improve the specificity of the population API too. Sometimes there just won't be a salmon population in the area, but detecting whether the area is outside BC is feasible.

rod-glover commented 1 year ago

Is it important to distinguish error cases from success cases with empty result? E.g., it's an error to query outside the domain, but not an error to query inside it but have no qualifying regions (therefore empty list)?