Err first standard
See original GitHub issueI’d like to use Bluebirds Promise.promisify
.
import Promise from 'bluebird'
import cmd from 'node-cmd'
const getAsync = Promise.promisify(cmd.get, { multiArgs: true, context: cmd })
getAsync('node -v').then(data => {
console.log('cmd data', data)
}).catch(err => {
console.log('cmd err', err)
})
This fails I think, because node-cmd
doesn’t use the standard node error-first pattern which Bluebird wants:
The node function should conform to node.js convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument.
The above code calls catch
but actually displays the contents of data
.
Any plans to switch to standard node-style error-first callbacks…?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Standard error - Wikipedia
The standard error (SE) of a statistic is the standard deviation of its sampling distribution or an estimate of that standard deviation.
Read more >What is the Standard Error of a Sample ? - Statistics How To
The standard error(SE) is very similar to standard deviation. Both are measures of spread. The higher the number, the more spread out your...
Read more >The Node.js Way - Understanding Error-First Callbacks
The error-first pattern was introduced into Node core to solve this very problem, and has since spread to become today's standard.
Read more >Error-First Callback in Node.js - GeeksforGeeks
The first argument in the function is reserved for the error object. If any error has occurred during the execution of the function,...
Read more >Standard Error in R (2 Example Codes) - Statistics Globe
Now, let's apply this standard error function. First, we need to create a numeric example vector in R… x <- c( ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
merged and released. Thank you 😃
the nvm was because I realised I made a dumb comment. It was obvious why it was breaking once I looked.