Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
error.go | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/error.go b/error.go
index bee8b70..b8e2900 100644
--- a/error.go
+++ b/error.go
@@ -583,6 +583,17 @@ func (err Error) Error() string {
err.Code, err.Domain, err.Message)
}
+func makeError(err *C.virError) Error {
+ ret := Error{
+ Code: ErrorNumber(err.code),
+ Domain: ErrorDomain(err.domain),
+ Message: C.GoString(err.message),
+ Level: ErrorLevel(err.level),
+ }
+ C.virResetError(err)
+ return ret
+}
+
func GetLastError() Error {
err := C.virGetLastError()
if err == nil {
--
2.17.1