Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Handling #82

Open
smizell opened this issue Sep 19, 2015 · 0 comments
Open

Error Handling #82

smizell opened this issue Sep 19, 2015 · 0 comments
Milestone

Comments

@smizell
Copy link
Contributor

smizell commented Sep 19, 2015

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) })
@smizell smizell added this to the Minim 1.0 milestone Sep 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant