Uncatched ClientException-s

Issue #136 resolved
wojteb created an issue

When I try get http://127.0.0.1:8000/2.2/anime/cast/2 I get 500 Symphony exception instead MAL 404.

Second: It is difficult to guess whether 500 is an application error, or download from the MAL.

You should wrap response with something like this.

{
    "status": <status-code>,
    "msg": "<informational message. might vary, use the status code in your code!>",
    "result": <result of the request. varies depending on the request>
}

Comments (2)

  1. Michael Johnson

    In general, errors via MAL are returned with an error structure as described in the documentation. If we aren't doing that and should, that's a bug.

    We may consider changing the error return value in a future release where we can break compatibility.

  2. Michael Johnson

    Fix Uncaught 404 in Cast

    Catch a situation where cast for a non-existent title would result in a server error. Now properly handle it and return a 404.

    Fixes #136

    → <<cset 0b46694837ed>>

  3. Log in to comment