From 108f06aedec8834a314ed884f2795758a82fdb68 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Mon, 21 Feb 2022 13:45:40 +0530 Subject: Removed any max limit for offset argument, since MAL doesn't even support that --- errhandlers/errhandlers.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'errhandlers/errhandlers.go') diff --git a/errhandlers/errhandlers.go b/errhandlers/errhandlers.go index 59a45ae..14c1d33 100644 --- a/errhandlers/errhandlers.go +++ b/errhandlers/errhandlers.go @@ -41,13 +41,10 @@ func FieldsErrHandler(fields []string) ([]string, error) { } // if limit or error specified are above the limit -func LimitsErrHandler(limit, offset, maxLimit int) error { - maxOffset := maxLimit - limit +func LimitErrHandler(limit, maxLimit int) error { if limit > maxLimit { return errors.New(fmt.Sprintf("InvalidLimitError: Limit specified too high (%d > %d).", limit, maxLimit)) - } else if offset > maxOffset { - return errors.New(fmt.Sprintf("InvalidOffsetError: Offset specified too high (%d > %d).", offset, maxOffset)) - } + } // return nil if no error return nil } -- cgit v1.2.3