Skip to content
Snippets Groups Projects
Commit 920f69b4 authored by Florian Spreckelsen's avatar Florian Spreckelsen
Browse files

Merge branch 'f-treat_error' into 'dev'

Treat error in collect_information

See merge request caosdb/caosdb-advanced-user-tools!66
parents 9c977cfd b6e09856
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 ...@@ -41,7 +41,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed ### ### Removed ###
### Fixed ### ### Fixed ###
- An exception in collect_information does no longer lead to a break down.
* Fixed an issue where `caosadvancedtools.cache.UpdateCache` would * Fixed an issue where `caosadvancedtools.cache.UpdateCache` would
cause an `sqlite3.IntegrityError` if more than one change was cached cause an `sqlite3.IntegrityError` if more than one change was cached
for the same entity. for the same entity.
......
...@@ -215,10 +215,36 @@ class Crawler(object): ...@@ -215,10 +215,36 @@ class Crawler(object):
errors_occured = True errors_occured = True
tbs.append(e) tbs.append(e)
logger.debug(separated("Number of Cfoods: "+str(len(cfoods))))
logger.debug(separated("CFoods are collecting information...")) logger.debug(separated("CFoods are collecting information..."))
remove_cfoods = []
for cfood in cfoods: for cfood in cfoods:
try:
cfood.collect_information() 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( logger.debug(
separated("Trying to attach further items to created CFoods")) 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.
Please register or to comment