You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
"status":408,
"type":"TimeoutException",
"message":"Request to MyAnimeList.net timed out (10 seconds)",
"error":"Idle timeout reached for \"https://myanimelist.net/anime/2356/_/characters\"."
}
The expected behaviour would be for the promise to be rejected.
I've only noticed this issue with getAnimeCharacters.
Also, this method (and a few others, such as getAnimeStaff return an object with a data property, whereas most methods (such as getAnimeFullById) unwrap the data property. I'm not sure why this is the case, as Jikan uses the data property in all responses.
I mention this because I'm not sure if this issue is unique to getAnimeCharacters, if it applies only to methods that include the data nesting, or if it applies to all methods.
EDIT: In my logs I can see I've experienced this issue 6 times for getAnimeCharacters. I have not yet experienced it for getAnimeStats or getAnimeFullById which are the only two other methods I'm using. It's possible that I simply haven't seen a timeout for these methods, but that seems unlikely because getAnimeStats times out pretty frequently (jikan-me/jikan-rest#269).
EDIT2: Turns out the same issue is (kinda) happening for getAnimeStats too. But because this function unwraps the data property, the promise resolves with undefined instead of the error object. I have 21 occurrences of this in my logs. (Out of 816 times that I called getAnimeStats)
I'll submit a PR to fix this some time within the next few days.
@LuckyYam Is it okay if I make a breaking change to make the response format consistent, always unwrapping data?
The text was updated successfully, but these errors were encountered:
YoshiWalsh
changed the title
anime.getAnimeCharacters sometimes resolves promise with error response
Marika doesn't throw an error if Jikan responds with an error
Apr 4, 2023
YoshiWalsh
added a commit
to YoshiWalsh/wrongopinions
that referenced
this issue
Apr 4, 2023
The promise resolved with
The expected behaviour would be for the promise to be rejected.
I've only noticed this issue with
getAnimeCharacters
.Also, this method (and a few others, such as
getAnimeStaff
return an object with adata
property, whereas most methods (such asgetAnimeFullById
) unwrap thedata
property. I'm not sure why this is the case, as Jikan uses thedata
property in all responses.I mention this because I'm not sure if this issue is unique to
getAnimeCharacters
, if it applies only to methods that include thedata
nesting, or if it applies to all methods.EDIT: In my logs I can see I've experienced this issue 6 times for
getAnimeCharacters
. I have not yet experienced it forgetAnimeStats
orgetAnimeFullById
which are the only two other methods I'm using. It's possible that I simply haven't seen a timeout for these methods, but that seems unlikely becausegetAnimeStats
times out pretty frequently (jikan-me/jikan-rest#269).EDIT2: Turns out the same issue is (kinda) happening for
getAnimeStats
too. But because this function unwraps thedata
property, the promise resolves withundefined
instead of the error object. I have 21 occurrences of this in my logs. (Out of 816 times that I calledgetAnimeStats
)I'll submit a PR to fix this some time within the next few days.
@LuckyYam Is it okay if I make a breaking change to make the response format consistent, always unwrapping
data
?The text was updated successfully, but these errors were encountered: