Example #1
0
func GitErrorLast() error {
	err := C.giterr_last()
	if err == nil {
		return &GitError{"No message", 0}
	}
	return &GitError{C.GoString(err.message), int(err.klass)}
}
Example #2
0
func MakeGitError(errorCode C.int) error {
	err := C.giterr_last()
	if err == nil {
		return &GitError{"No message", C.GITERR_INVALID, C.GIT_ERROR}
	}
	return &GitError{C.GoString(err.message), int(err.klass), int(errorCode)}
}
Example #3
0
File: error.go Project: tmc/goit
// Returns a GitError or nil
func gitError(errorCode C.int) error {
	if errorCode != err_OK {
		ge := C.giterr_last()
		return &GitError{C.GoString(ge.message), int(ge.klass)}
	}
	return nil
}
Example #4
0
func MakeGitError(errorCode C.int) error {

	var errMessage string
	var errClass ErrorClass
	if errorCode != ErrIterOver {
		err := C.giterr_last()
		if err != nil {
			errMessage = C.GoString(err.message)
			errClass = ErrorClass(err.klass)
		} else {
			errClass = ErrClassInvalid
		}
	}
	return &GitError{errMessage, errClass, ErrorCode(errorCode)}
}
Example #5
0
File: git.go Project: fsouza/gogit
func lastErr() GitError {
	err := C.giterr_last()
	return GitError(C.GoString(err.message))
}
Example #6
0
File: git.go Project: stvp/git2go
func LastError() error {
	err := C.giterr_last()
	return &GitError{C.GoString(err.message), int(err.klass)}
}
Example #7
0
func gitError() error {
	ge := C.giterr_last()
	msg := C.GoString(ge.message)
	C.giterr_clear()
	return errors.New(msg)
}