No breaking changes to the API yet, but preparing for introducing its new version by extracting the response shaping outta handlers. So the on_api_command method will be the only one who operates flask.
Handlers, on the other hand, are either return data OR raise exceptions.
For that, introducing also HandlingException class, accepting the HTTP status code that is supposed to be used for managing the response in case of an error raised during handling the request.
Preserving (for now) the original behaviour of update command, which in case of disabled relay responds with status: error instead of aborting.
coverage: 100.0%. remained the same when pulling ee6ebd06358932d093b53b8880d193e5616c49a5 on issue-164-api-inconsistency into 253707749ab1fef1249acd70275aac4c27248a61 on develop.
Contributes to #164
No breaking changes to the API yet, but preparing for introducing its new version by extracting the response shaping outta handlers. So the
on_api_command
method will be the only one who operatesflask
.Handlers, on the other hand, are either return data OR raise exceptions.
For that, introducing also
HandlingException
class, accepting the HTTP status code that is supposed to be used for managing the response in case of an error raised during handling the request.Preserving (for now) the original behaviour of
update
command, which in case of disabled relay responds withstatus: error
instead of aborting.