Skip to content

Instantly share code, notes, and snippets.

@joepie91
Forked from zontafil/gist:ad03e4d8544efdbff0df
Last active November 1, 2015 16:09
Show Gist options
  • Save joepie91/d382ebe23dc92df6fad7 to your computer and use it in GitHub Desktop.
Save joepie91/d382ebe23dc92df6fad7 to your computer and use it in GitHub Desktop.
var Promise = require("bluebird");
function promisifyWaterline(action){
return Promise.try(function() {
return action();
}).catch(function(err) {
// you should almost never catch errors inline. ONLY do it if you need to 'repackage' an error.
// definitely don't do the below, as you lose the original error.
throw new Error("lol");
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment