1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-11 10:18:08 +09:00

Add error unwrapping

This commit is contained in:
mcrakhman 2023-03-06 09:41:45 +01:00
parent 58f01da459
commit e1f6dad499
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B

View file

@ -7,6 +7,7 @@ import (
"github.com/anytypeio/any-sync/commonspace/object/tree/treechangeproto"
"github.com/anytypeio/any-sync/coordinator/coordinatorproto"
"github.com/anytypeio/any-sync/net/pool"
"github.com/anytypeio/any-sync/net/rpc/rpcerr"
"github.com/anytypeio/any-sync/nodeconf"
)
@ -40,6 +41,7 @@ func (c *coordinatorClient) ChangeStatus(ctx context.Context, spaceId string, de
DeletionChangePayload: deleteRaw.GetRawChange(),
})
if err != nil {
err = rpcerr.Unwrap(err)
return
}
status = resp.Payload
@ -55,6 +57,7 @@ func (c *coordinatorClient) StatusCheck(ctx context.Context, spaceId string) (st
SpaceId: spaceId,
})
if err != nil {
err = rpcerr.Unwrap(err)
return
}
status = resp.Payload
@ -81,6 +84,7 @@ func (c *coordinatorClient) SpaceSign(ctx context.Context, spaceId string, space
Header: spaceHeader,
})
if err != nil {
err = rpcerr.Unwrap(err)
return
}
return resp.Receipt, nil
@ -96,6 +100,7 @@ func (c *coordinatorClient) FileLimitCheck(ctx context.Context, spaceId string,
SpaceId: spaceId,
})
if err != nil {
err = rpcerr.Unwrap(err)
return
}
return resp.Limit, nil