Hexagon / node-telldus

Node bindings for telldus-core
Other
34 stars 10 forks source link

Should getXXXX return a err if empty or UNKNOWN? #28

Closed kmpm closed 10 years ago

kmpm commented 10 years ago

First let me describe what the sync version does.

If you have a spanking new device that you just added with addDevice and then tries to, for example getNameSync. It will then return an empty string which is sort of correct and in my opinion should NOT be considered as an error in the async version of the same method.

If you try to do getName for an non existing device id you will get the string 'UNKNOWN' back. I would be ok regarding this as an error.

Votes please...

P.S. I think this is for all string returning methods, if anyone knows anything else then please tell me.

Hexagon commented 10 years ago

My vote goes for: Empty string! No name clause in an existing device clause should have equal functionality to name = ""

kmpm commented 10 years ago

So no error for empty string and error if 'UNKNOWN'?

Hexagon commented 10 years ago

Yep!

nilzen commented 10 years ago

No error for an empty string sounds correct to me to.

kmpm commented 10 years ago

Closed with PR #36