Skip to content

Commit

Permalink
Merge pull request #16988 from mvdbeek/warning_for_duplicate_log_files
Browse files Browse the repository at this point in the history
[23.1] Change log level for duplicate data table entries to warning
  • Loading branch information
mvdbeek authored Nov 16, 2023
2 parents d0c583e + ec32669 commit 427677a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/galaxy/tool_util/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,11 @@ def add_entries(
self.add_entry(
entry, allow_duplicates=allow_duplicates, persist=persist, entry_source=entry_source, **kwd
)
except MessageException as e:
if e.type == "warning":
log.warning(str(e))
else:
log.error(str(e))
except Exception as e:
log.error(str(e))
return self._loaded_content_version
Expand Down Expand Up @@ -686,7 +691,8 @@ def _add_entry(
self.data.append(fields)
else:
raise MessageException(
f"Attempted to add fields ({fields}) to data table '{self.name}', but this entry already exists and allow_duplicates is False."
f"Attempted to add fields ({fields}) to data table '{self.name}', but this entry already exists and allow_duplicates is False.",
type="warning",
)
else:
raise MessageException(
Expand Down

0 comments on commit 427677a

Please sign in to comment.