-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
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 calledBut 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.
Reactions are currently unavailable