Update neofs-api-go to latest version

Handle errors provided by JSON encoders.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-10-29 19:36:59 +03:00 committed by Alex Vanin
parent b48a4ede02
commit b12d26f974
5 changed files with 35 additions and 24 deletions

View file

@ -624,11 +624,11 @@ func getBearerToken(cmd *cobra.Command, flagname string) (*token.BearerToken, er
return nil, fmt.Errorf("can't read bearer token file: %w", err)
}
v2token := v2ACL.BearerTokenFromJSON(data)
if v2token == nil {
v2token, err := v2ACL.BearerTokenFromJSON(data)
if err != nil {
msg := new(grpcACL.BearerToken)
if proto.Unmarshal(data, msg) != nil {
return nil, errors.New("can't decode bearer token")
return nil, fmt.Errorf("can't decode beare token: %w", err)
}
v2token = v2ACL.BearerTokenFromGRPCMessage(msg)