From 5eb7a3cd41826fccdc432d049dd85a31b4b56073 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Wed, 15 Jun 2022 00:39:23 +0530 Subject: added status command to directly set status for an anime --- mal/status.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'mal/status.go') diff --git a/mal/status.go b/mal/status.go index 06d7773..422a838 100644 --- a/mal/status.go +++ b/mal/status.go @@ -19,12 +19,18 @@ along with this program. If not, see . package mal import ( - "log" + "fmt" + "os" ) func SetStatus(animeId int, status string) { - resp, _ := userAnimeClient.SetStatus(animeId, status) + resp, err := userAnimeClient.SetStatus(animeId, status) + if err != nil { + fmt.Println("Error while parsing status:", err.Error()) + os.Exit(1) + } if resp.Error != "" { - log.Println("MyAnimeList reported error on SetStatus", resp.Error, resp.Message) + fmt.Println("MyAnimeList reported error on SetStatus", resp.Error, resp.Message) + os.Exit(1) } } -- cgit v1.2.3