atlanticwave-sdx / sdx-controller

Central Controller for AtlanticWave SDX.
https://www.atlanticwave-sdx.net
MIT License
2 stars 3 forks source link

Error handling when looking up a connection #34

Closed sajith closed 6 months ago

sajith commented 2 years ago

What should getconnection_by_id() do when the requested item is not in the database?

https://github.com/atlanticwave-sdx/sdx-controller/blob/98fe1ce51070415b3d97b39b55a664345c86bb35/swagger_server/controllers/connection_controller.py#L76-L87

As a result of the above implementation, currently it returns nothing (or None), which results in a HTTP "204 No Content" response code when you do a GET /connection/{connection_id}. The correct-er response should be "404 Not Found".