-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Milestone
Description
There needs to be a way to handle errors in Minim. Some options:
Throw JavaScript errors
minim.toElement({ foo: 'bar'})
.get('a') // Undefined and throws error
.set('b', 'c')Create special Minim Error object
With the latter, we can attach methods from every element, and then (try to) mimic promises.
minim.toElement({ foo: 'bar'})
.get('a') // Undefined and should create an error
.set('b', 'c') // The error object would simply pass itself along
.then(function() { console.log('all good') })
.catch(function(error) { console.log('oops', error) })