diff options
author | Vidhu Kant Sharma <vidhukant@protonmail.ch> | 2022-06-15 00:39:23 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@protonmail.ch> | 2022-06-15 00:39:23 +0530 |
commit | 5eb7a3cd41826fccdc432d049dd85a31b4b56073 (patch) | |
tree | c41cda8e9b4648991b85d44405397212612b2bc7 /mal | |
parent | 028632de277704fe4576e732d4997daa70f25f60 (diff) |
added status command to directly set status for an anime
Diffstat (limited to 'mal')
-rw-r--r-- | mal/status.go | 12 |
1 files changed, 9 insertions, 3 deletions
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 <http://www.gnu.org/licenses/>. 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) } } |