aboutsummaryrefslogtreecommitdiff
path: root/errhandlers
diff options
context:
space:
mode:
authorVidhu Kant Sharma <bokuwakanojogahoshii@yahoo.com>2022-02-21 08:17:20 +0000
committerGitHub <noreply@github.com>2022-02-21 08:17:20 +0000
commit8c685067611d829e5fb8eeaaba48508d15cd4dde (patch)
treea1ddcf1469d563d26d5c23afe8a58fecb3dad0c4 /errhandlers
parentdbd642c32b1d2075cc5d0d00e29433753b742d13 (diff)
parent108f06aedec8834a314ed884f2795758a82fdb68 (diff)
Merge pull request #5 from MikunoNaka/offset-limit-fix
Removed any max limit for offset argument, since MAL doesn't even support that
Diffstat (limited to 'errhandlers')
-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
}