MCPcopy Create free account
hub / github.com/libgit2/git2go / MakeGitError

Function MakeGitError

git.go:319–336  ·  view source on GitHub ↗
(c C.int)

Source from the content-addressed store, hash-verified

317}
318
319func MakeGitError(c C.int) error {
320 var errMessage string
321 var errClass ErrorClass
322 errorCode := ErrorCode(c)
323 if errorCode != ErrorCodeIterOver {
324 err := C.git_error_last()
325 if err != nil {
326 errMessage = C.GoString(err.message)
327 errClass = ErrorClass(err.klass)
328 } else {
329 errClass = ErrorClassInvalid
330 }
331 }
332 if errMessage == "" {
333 errMessage = errorCode.String()
334 }
335 return &GitError{errMessage, errClass, errorCode}
336}
337
338func MakeGitError2(err int) error {
339 return MakeGitError(C.int(err))

Callers 15

DefaultRebaseOptionsFunction · 0.85
InitRebaseMethod · 0.85
OpenRebaseMethod · 0.85
NextMethod · 0.85
InmemoryIndexMethod · 0.85
CommitMethod · 0.85
FinishMethod · 0.85
AbortMethod · 0.85
toCMethod · 0.85
DefaultSignatureMethod · 0.85
DefaultRevertOptionsFunction · 0.85
RevertMethod · 0.85

Calls 3

ErrorCodeTypeAlias · 0.85
ErrorClassTypeAlias · 0.85
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…