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/manga/mangalist.go | |
parent | 95b8ab702708538ccaf26efd141b448148ac6d6d (diff) |
Exported all the errors so programs using this library can customize error messages.
Diffstat (limited to 'user/manga/mangalist.go')
-rw-r--r-- | user/manga/mangalist.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/user/manga/mangalist.go b/user/manga/mangalist.go index 009a65c..af75e9f 100644 --- a/user/manga/mangalist.go +++ b/user/manga/mangalist.go @@ -20,7 +20,6 @@ import ( "encoding/json" "strconv" "fmt" - "errors" e "github.com/MikunoNaka/MAL2Go/errhandlers" u "github.com/MikunoNaka/MAL2Go/util" ) @@ -56,12 +55,12 @@ func (c Client) GetMangaList(user, status, sort string, limit, offset int, field // checks if valid sort is specified if !e.IsValidMangaListSort(sort) { - return userMangaList, errors.New(fmt.Sprintf("GetMangaList: Invalid sort specified: \"%s\"", sort)) + return userMangaList, e.InvalidSortError } // checks if valid status is specified if status != "" && !e.IsValidMangaListStatus(status) { - return userMangaList, errors.New(fmt.Sprintf("GetMangaList: Invalid status specified: \"%s\"", status)) + return userMangaList, e.InvalidStatusError } // get own list if user not specified |