driplineorg / dripline-python

python implementation of project8/dripline
Apache License 2.0
3 stars 6 forks source link

Endpoint should check that payloads can be converted to param #127

Open nsoblath opened 4 years ago

nsoblath commented 4 years ago

File: endpoint.py Class: Endpoint Functions:

Each of those has a line that's something like:

return a_request_message.reply(payload=scarab.to_param(result))

There's no check for whether the result object can in fact be converted to param. Instead, this should be done in a try block to catch the case in which the result cannot be converted to a python object. In that case the return message should have an error return code.