Skip to content
Snippets Groups Projects
Commit b6e09856 authored by Henrik tom Wörden's avatar Henrik tom Wörden Committed by Florian Spreckelsen
Browse files

Treat error in collect_information

parent 9c977cfd
No related branches found
No related tags found
1 merge request!22Release 0.3
......@@ -41,7 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ###
### Fixed ###
- An exception in collect_information does no longer lead to a break down.
* Fixed an issue where `caosadvancedtools.cache.UpdateCache` would
cause an `sqlite3.IntegrityError` if more than one change was cached
for the same entity.
......
......@@ -215,10 +215,36 @@ class Crawler(object):
errors_occured = True
tbs.append(e)
logger.debug(separated("Number of Cfoods: "+str(len(cfoods))))
logger.debug(separated("CFoods are collecting information..."))
remove_cfoods = []
for cfood in cfoods:
cfood.collect_information()
try:
cfood.collect_information()
except DataInconsistencyError as e:
logger.debug(traceback.format_exc())
logger.debug(e)
remove_cfoods.append(cfood)
except Exception as e:
try:
DataModelProblems.evaluate_exception(e)
except BaseException:
pass
logger.debug("Failed during execution of {}!".format(
Cfood.__name__))
logger.debug(traceback.format_exc())
logger.debug(e)
remove_cfoods.append(cfood)
if self.abort_on_exception:
raise e
for rm in remove_cfoods:
cfoods.remove(rm)
logger.debug("Removed {} due to an Error in "
"collect_information".format(str(rm)))
logger.debug(
separated("Trying to attach further items to created CFoods"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment