-
-
Save joepie91/d382ebe23dc92df6fad7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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