Expose JavaScript function name in a rejected promise#1393
Merged
implausible merged 1 commit intonodegit:masterfrom Nov 28, 2017
Merged
Expose JavaScript function name in a rejected promise#1393implausible merged 1 commit intonodegit:masterfrom
implausible merged 1 commit intonodegit:masterfrom
Conversation
When an error happens in libgit2, NodeGit will wrap the and expose the error code and message to be consumed via the JavaScript API. However, this information is often insufficient given the asynchronous nature of NodeGit and it may at times be unclear as to which JavaScript function caused the error on the libgit2 side. By exposing an 'errorFunction' property string that includes the name of the JavaScript function in the error, debugging should now be a lot easier as clients will now be able to quickly identify which JavaScript function in a long promise chain was the source of an error. Signed-off-by: Remy Suen <remy.suen@gmail.com>
Collaborator
|
I like this! Nice work. @implausible what do you think? Not a perfect solution but helpful none-the-less. |
Member
|
Radical @rcjsuen! |
implausible
approved these changes
Nov 28, 2017
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've modified the
async_function.cctemplate to include both the names of the JavaScript class and function in the error thrown in a rejected promise. This should hopefully make debugging NodeGit a lot easier when there's a long promise chain.