From b6f42d806d0e0f5e59c7615cd1558e75c5b314f1 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Sun, 6 Mar 2022 00:51:36 +0530 Subject: Exported all the errors so programs using this library can customize error messages. --- user/manga/mangalist.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'user/manga/mangalist.go') 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 -- cgit v1.2.3