removed obsolete errors
This commit is contained in:
@@ -249,15 +249,15 @@ func (s *Service) getStatementResponder(_ context.Context, req *ledgerv1.GetStat
|
||||
func parseCursor(cursor string) (int, error) {
|
||||
decoded, err := base64.StdEncoding.DecodeString(cursor)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("invalid base64: %w", err)
|
||||
return 0, merrors.InvalidArgumentWrap(err, "invalid cursor base64 encoding")
|
||||
}
|
||||
parts := strings.Split(string(decoded), ":")
|
||||
if len(parts) != 2 || parts[0] != "offset" {
|
||||
return 0, fmt.Errorf("invalid cursor format")
|
||||
return 0, merrors.InvalidArgument("invalid cursor format")
|
||||
}
|
||||
offset, err := strconv.Atoi(parts[1])
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("invalid offset: %w", err)
|
||||
return 0, merrors.InvalidArgumentWrap(err, "invalid cursor offset")
|
||||
}
|
||||
return offset, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user