itm / wsn-device-drivers

Drivers for Wireless Sensor Network Devices
Other
6 stars 4 forks source link

Return UnsupportedOperationExeception when a Device return null for an Operation #31

Closed mlegenhausen closed 13 years ago

mlegenhausen commented 13 years ago

Some notes:

Pros: No unnecessary operation is added to the queue only for returning UnsupportedOperationException

Cons: You have to check for this exception directly when calling the async method instead of catching them in the callback. But synchronious exception handing is always better than async ;)

mlegenhausen commented 13 years ago

Please note to surround your DeviceAsync calls with a try and catch block to handle UnsupportedOperationExceptions.