When passing in bad values to .set or .put, sometimes the callbacks are invoked, and sometimes they aren't. For example:
Gun().get('test').set(NaN, function () {
console.log(arguments)
})
// the function is never called
But if you pass in Infinity instead, the callback will fire, passing in an error object with the message "Invalid value at [soul]!". But it doesn't stop there! There's even inconsistency between .set and .put (even though .set uses .put under the hood).
Gun().get('test').path('callback madness').set(Infinity, callback)
// invoked, error given. Let's try put this time...
Gun().get('test').path('callback madness').put(Infinity, callback)
// not invoked, no error! What?
These errors might be the last string of sanity that beginners have, since gun doesn't throw traditional errors.
When passing in bad values to
.setor.put, sometimes the callbacks are invoked, and sometimes they aren't. For example:But if you pass in Infinity instead, the callback will fire, passing in an error object with the message
"Invalid value at [soul]!". But it doesn't stop there! There's even inconsistency between.setand.put(even though.setuses.putunder the hood).These errors might be the last string of sanity that beginners have, since gun doesn't throw traditional errors.