electricimp / AgentStorage

A library for easily managing the server.save table
MIT License
1 stars 0 forks source link

server Send Error Codes are not being verified #2

Open deldrid1 opened 6 years ago

deldrid1 commented 6 years ago

According to https://developer.electricimp.com/api/server/save/, server.save() can return an error... In practice, I think this occurs rarely, although also in practice, in the event it fails, it could have some serious consequences...

I'm not sure what the right thing to do is (throw, server.error, ???), but shouldn't the library implement some kind of protection related to the Send Error Codes?

betzrhodes commented 6 years ago

I agree the library should check this. Maybe add an onError callback to the library. I hesitate to throw an error, but adding a callback allows the user the option to handle an error.