diff options
author | Vidhu Kant Sharma <vidhukant@protonmail.ch> | 2022-03-06 00:51:36 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@protonmail.ch> | 2022-03-06 00:51:36 +0530 |
commit | b6f42d806d0e0f5e59c7615cd1558e75c5b314f1 (patch) | |
tree | c9c014759f62c44520be305a60546d08140876f4 /user/anime/animelist.go | |
parent | 95b8ab702708538ccaf26efd141b448148ac6d6d (diff) |
Exported all the errors so programs using this library can customize error messages.
Diffstat (limited to 'user/anime/animelist.go')
-rw-r--r-- | user/anime/animelist.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/user/anime/animelist.go b/user/anime/animelist.go index f6d9965..2840df3 100644 --- a/user/anime/animelist.go +++ b/user/anime/animelist.go @@ -20,7 +20,6 @@ import ( "encoding/json" "strconv" "fmt" - "errors" a "github.com/MikunoNaka/MAL2Go/anime" e "github.com/MikunoNaka/MAL2Go/errhandlers" u "github.com/MikunoNaka/MAL2Go/util" @@ -57,12 +56,12 @@ func (c Client) GetAnimeList(user, status, sort string, limit, offset int, field // checks if valid sort is specified if !e.IsValidListSort(sort) { - return userAnimeList, errors.New(fmt.Sprintf("GetAnimeList: Invalid sort specified: \"%s\"", sort)) + return userAnimeList, e.InvalidSortError } // checks if valid status is specified if status != "" && !e.IsValidListStatus(status) { - return userAnimeList, errors.New(fmt.Sprintf("GetAnimeList: Invalid status specified: \"%s\"", status)) + return userAnimeList, e.InvalidStatusError } // get own list if user not specified |