From 71210ebc8e04d49a6afeeecee842b2e8b53f3c4f Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Thu, 16 Jun 2022 21:41:22 +0530 Subject: handling server errors in user, manga and anime package --- util/structs.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'util') diff --git a/util/structs.go b/util/structs.go index cb1f052..798b8e0 100644 --- a/util/structs.go +++ b/util/structs.go @@ -48,23 +48,18 @@ var DefaultMangaFields []string = []string{ "related_manga", "recommendations", "serialization", } -// contains previous/next page for anime list -// we don't actually need this. -// TODO: for compatibility's sake, keep this but also define methods -// to get the prev. and next page's elements automatically -type ListPaging struct { - NextPage string `json:"next"` - PrevPage string `json:"previous"` +type APIError struct { + Err string `json:"error"` + Msg string `json:"message"` } -/* these structs are used +/* these structs are used * both by anime and manga package */ type Picture struct { Medium string `json:"medium"` Large string `json:"large"` } -// for some reason the API returns them as string type StatusStatistics struct { Watching string `json:"watching"` Completed string `json:"completed"` -- cgit v1.2.3