calmh / node-snmp-native

Native Javascript SNMP library for Node.js
MIT License
252 stars 65 forks source link

in getAll, added callback error. #1

Closed fmgdias closed 12 years ago

calmh commented 12 years ago

Thanks. This is an issue I ignored, but it requires thinking it through a little more. We probably don't want to call the callback more than once. Should we abort the entire getAll if one get fails? Continue fetching the rest and call the callback with both error and data arrays? Hmm.

fmgdias commented 12 years ago

" Continue fetching the rest and call the callback with both error and data arrays?... hum.... i think it is the best solution.... thx for your reply...

calmh commented 12 years ago

I actually ended up going with the choice of continuing or stopping on error; what do you think of e0398ed6?

It adds a new parameter abortOnErrors:

// If abortOnErrors is truish, an error while getting any of the values
// will cause the callback to be called with error status. When abortOnErrors
// is falsish (the default), any errors will be ignored and any successfully
// retrieved values sent to the callback.
fmgdias commented 12 years ago

nice, i sended a mail to you...check jakob@nym.se...=)