Skip to content

Commit

Permalink
fix(EuropeanDynamicsBase): FileError errors should be a dict
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Apr 8, 2024
1 parent 68acc63 commit c5a74d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
6 changes: 1 addition & 5 deletions kingfisher_scrapy/spiders/chile_compra_bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ def build_file(self, file_name=None, url=None, data=None, **kwargs):
# }
if json_data.get('status') != 200:
json_data['http_code'] = json_data['status']
return FileError({
'file_name': file_name,
'url': url,
'errors': json_data,
})
return FileError({'file_name': file_name, 'url': url, 'errors': json_data})
else:
return super().build_file(file_name=file_name, url=url, data=data, **kwargs)
2 changes: 1 addition & 1 deletion kingfisher_scrapy/spiders/european_dynamics_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def parse_list(self, response):
data = response.json()
# The response can be an HTML document with an error message like "temporary unavailable due to maintenance".
except JSONDecodeError:
return self.build_file_error_from_response(response, errors=response.text)
return self.build_file_error_from_response(response, errors={"text": response.text})
for number, url in enumerate(reversed(data['packagesPerMonth'])):
path = urlsplit(url).path
if self.from_date and self.until_date:
Expand Down

0 comments on commit c5a74d4

Please sign in to comment.