Skip to content

Commit 8086f00

Browse files
committed
List wraps the error from secretservice_linux.c.
List wraps the error from secretservice_linux.c so the List can give the caller more useful error message for diagnosing. Signed-off-by: Qi Wang <[email protected]>
1 parent fc9290a commit 8086f00

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

secretservice/secretservice_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ func (h Secretservice) List() (map[string]string, error) {
9696
defer C.freeListData(&acctsC, listLenC)
9797
if err != nil {
9898
defer C.g_error_free(err)
99-
return nil, errors.New("Error from list function in secretservice_linux.c likely due to error in secretservice library")
99+
errMsg := (*C.char)(unsafe.Pointer(err.message))
100+
return errors.New(C.GoString(errMsg))
100101
}
101102

102103
resp := make(map[string]string)

0 commit comments

Comments
 (0)