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/anime/animelist.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'user/anime/animelist.go') 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 -- cgit v1.2.3