Skip to content

Instantly share code, notes, and snippets.

@joeRinehart
Created April 18, 2018 15:12
Show Gist options
  • Save joeRinehart/05842c86b2df781c12c9fe5a18012a34 to your computer and use it in GitHub Desktop.
Save joeRinehart/05842c86b2df781c12c9fe5a18012a34 to your computer and use it in GitHub Desktop.
Why the heck is it always catching?!?! Oh...derp.
class Thing {
doStuffWithFile( file ) {
return new Promise( ( reject, resolve ) => {
/*
do shit...
*/
resolve(stuff)
})
}
}
var thing = new Thing()
thing.doStuffWithFile('someFile')
.then( () => {
console.log("good!") }
)
.catch( (error) => {
console.log("error", error)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment