'Checks the response from Download Station, and logs any errors
params: :data: post data sent in the original request, in case we need to send it with adjusted parameters
:file: file data being sent with the post request, if any'

def _check_response(self, data=None, files=None):

    try:
        jdata = self.response.json()
    except (ValueError, AttributeError):
        logger.log(u'Could    not    convert    response    to    json,    check    the    host:port:    {0!r}'.format(self.response))
        return False
    if (not jdata.get(u'success')):
        error_code = jdata.get(u'error', {}).get(u'code')
        if (error_code == 403):
            destination = (data or {}).get(u'destination')
            if (destination and os.path.isabs(destination)):
                data[u'destination'] = re.sub(u'^/volume\\d/', u'', destination).lstrip(u'/')
                self._request(method=u'post', data=data, files=files)
                try:
                    jdata = self.response.json()
                except ValueError:
                    return False
                if jdata.get(u'success'):
                    if (destination == sickbeard.SYNOLOGY_DSM_PATH):
                        sickbeard.SYNOLOGY_DSM_PATH = data[u'destination']
                    elif (destination == sickbeard.TORRENT_PATH):
                        sickbeard.TORRENT_PATH = data[u'destination']
    if (not jdata.get(u'success')):
        error_code = jdata.get(u'error', {}).get(u'code')
        api_method = (data or {}).get(u'method', u'login')
        log_string = self.error_map.get(api_method)[error_code]
        logger.log(u'{0}'.format(log_string))
    return jdata.get(u'success')
