aboutsummaryrefslogtreecommitdiff
path: root/errhandlers/errhandlers.go
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@protonmail.ch>2022-02-21 13:45:40 +0530
committerVidhu Kant Sharma <vidhukant@protonmail.ch>2022-02-21 13:45:40 +0530
commit108f06aedec8834a314ed884f2795758a82fdb68 (patch)
treeeb868558182cc44b54229a16947baa00db1a1a9a /errhandlers/errhandlers.go
parent244d42b40ca9eb2158c2a4e36a2ab183ea5afb73 (diff)
Removed any max limit for offset argument, since MAL doesn't even support that
Diffstat (limited to 'errhandlers/errhandlers.go')
-rw-r--r--errhandlers/errhandlers.go7
1 files changed, 2 insertions, 5 deletions
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
}