| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
When an API function of libgit2 fails within a promise, the promise is rejected with a JavaScript Error object that wraps the recorded error message in giterr_last(). However, the original non-zero return code of the API function is not exposed to the caller of the NodeGit API. This means that NodeGit clients cannot easily identify what the cause of an error is outside of parsing the Error object's message. This is an extremely volatile way of determining the cause as libgit2 may choose to alter the wording of the message at any time. To solve the problem above, the returned JavaScript Error object now esposes the libgit2 error code via its `errno` property.
There was a problem hiding this comment.
Just conflicts that need to be resolved then this is GTG.
Sorry, something went wrong.
Merge in the latest changes and resolved a conflict by explicitly referencing the v8 namespace when using Local types.
libgit2 has changed all their error messages to start with a lowercased character. Updated the test to reflect this change.
| Back | FazBrowse Home | New Git URL |
This PR fixes up the C++ templates so that libgit2's error code is exposed on the JavaScript side by analyzing the rejected promise.