func GetLastError() string { err := C.virGetLastError() errMsg := fmt.Sprintf("[Code-%d] [Domain-%d] %s", err.code, err.domain, C.GoString(err.message)) C.virResetError(err) return errMsg }
// LastError provides a pointer to the last error caught at the library level. // The error object is kept in thread local storage, so separate threads can // safely access this concurrently. func LastError() *Error { cError := C.virGetLastError() if cError == nil { log.Println("LastError() did not return an error") } return NewError(cError) }
func GetLastError() VirError { err := C.virGetLastError() if err == nil { return ErrNoError } virErr := newError(err) C.virResetError(err) return virErr }
func GetLastError() VirError { var virErr VirError err := C.virGetLastError() virErr.Code = int(err.code) virErr.Domain = int(err.domain) virErr.Message = C.GoString(err.message) virErr.Level = int(err.level) C.virResetError(err) return virErr }
func GetLastError() *LibvirtError { err := C.virGetLastError() defer C.virResetError(err) return newLibvirtError(err) }