gost / server

GOST - Go implementation of OGC SensorThings API
MIT License
61 stars 19 forks source link

post observation with non-existing datastream should return with error 400 not 500 #28

Closed bertt closed 8 years ago

bertt commented 8 years ago

sample:

curl -X POST -H "Accept: application/json" -H "Content-Type: application/json" -d '{ "phenomenonTime": "2016-05-09T11:04:15.790Z", "resultTime" : "2016-05-09T11:04:15.790Z", "result" : 38, "Datastream":{"@iot.id":1} }' "http://gost.geodan.nl/v1.0/Observations"

Actual response: 500 internal server error Expected response: 400 client error

tebben commented 8 years ago

fixed https://github.com/Geodan/gost/commit/85cf985c55a9246637dbef6efa4f25848c22a6ab

{ "error": { "status": "Bad Request", "code": 400, "message": [ "Observation does not exist" ] } }

bertt commented 8 years ago

message must be 'Datastream does not exist'?

tebben commented 8 years ago

woops, fixed