Fails silently - not working at all
See original GitHub issueWrote some exploratory tests to evaluate whether to use this library. To my surprise, it just does not work at all for me.
So the issue here is twofold. Number one, it does not work, and number two, there is no meaningful output that may hint to the reason why it does not work.
describe("retrieve git history", function() {
it.only("should retreive history", () => {
const simpleGit = require('simple-git')();
console.log('Have simpleGit', simpleGit, process.cwd())
simpleGit.log({ multiLine: true }).then((gitLog)=>{
console.log('HAVE LOG', gitLog)
})
simpleGit.status((cbStatus)=>{
console.log('cbStatus', cbStatus)
}).then((gitStatus)=>{
console.log('GIT STATUS', gitStatus)
})
})
})
This results in this output:
HAVE LOG undefined
cbStatus null
GIT STATUS undefined
On OsX 10.14.6,
git --version Fri Dec 6 10:51:16 2019
git version 2.20.1 (Apple Git-117)
And just to be clear, git log
and git status
work fine in that same directory.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to handle errors with grace: failing silently is not an option
Failing silently means errors can go undetected for quite a while before exploding suddenly at inconvenient and unpredictable times.
Read more >PHP fails silently when function not defined? - Stack Overflow
I am still getting some errors but I used to get an error when I called a function that was not defined, but...
Read more >No more silent failures! - Medium
If something unexpected happens, it will fail silently. What if I don't want to be notified for a specific exception?
Read more >Blog - Silent Failure - Michael Tsai
Even a bad error message, something that just says “An Error Occurred” with no indication of what the error was, is better than...
Read more >Should a program fail on errors or silently ignore them
Whether the program should fail or not depends a lot on the context. If you can handle the error gracefully, go for it....
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 FreeTop 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
Top GitHub Comments
Ah, the first should have been:
The code in your example above is using
.then
which is a deprecated api - insimple-git
the then method runs an arbitrary function at that point of the chain, whereas insimple-git/promise
it is the fulfilment handler promise generated by the step in the chain.Please try either of these: