protected function createApiException(Request $request, Response $response, \Exception $previous= null)
    {
        $errors = json_decode((string) $response->getBody());

        return new TmdbApiException(
            isset($errors->status_code) ? $errors->status_code : $response->getCode(),
            isset($errors->status_message) ? $errors->status_message : null,
            $request,
            $response,
            $previous
        );
    }