how about returning a promise instead ? :)

This looks like to be a perfect fit ! Then you can either resolve (if success) or reject (if error) :)