ohcnetwork / life

Verified Crowd-Sourced Emergency Services Directory
https://life.coronasafe.network/
82 stars 56 forks source link

Missing parameter in new randomised response API results into 404 instead of 404 bad request #251

Closed jitendraag closed 3 years ago

jitendraag commented 3 years ago

Describe the bug When someone hits the following incorrect URL:

https://life-pipeline.coronasafe.network/api/resources?resource=oxygen&state=maharashtra

They get a 404 response with following error message: {"error":"Unable to verify state or district or resource"} To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://life-pipeline.coronasafe.network/api/resources?resource=oxygen&state=maharashtra'
  2. See error (You can also curl this)

curl -ik "https://life-pipeline.coronasafe.network/api/resources?resource=oxygen&state=maharashtra"

Expected behavior

  1. 405 status response expected instead of 404
  2. Error message should explain the error so that the person reading the error understands how they can fix the issue.

Screenshots NA

Desktop (please complete the following information): NA

Smartphone (please complete the following information): NA

Additional context NA