Unverified Commit 0bbb982c authored by davelopez's avatar davelopez
Browse files

Handle errors creating new entries more gracefully

parent e765e669
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ from typing import (

from typing_extensions import Unpack

from galaxy.exceptions import AuthenticationRequired
from galaxy.exceptions import MessageException
from galaxy.files import ProvidesUserFileSourcesUserContext
from galaxy.files.sources import (
    BaseFilesSource,
@@ -199,7 +199,7 @@ class RDMFilesSource(BaseFilesSource):
            effective_props = self._serialization_props(user_context)
            token = effective_props.get("token")
        if not token:
            raise AuthenticationRequired(
            raise MessageException(
                f"Please provide a personal access token in your user's preferences for '{self.label}'"
            )
        return token
+3 −0
Original line number Diff line number Diff line
@@ -162,6 +162,9 @@ class RemoteFilesManager:
        file_source = file_source_path.file_source
        try:
            result = file_source.create_entry(entry_data.dict(), user_context=user_file_source_context)
        except exceptions.MessageException:
            log.warning(f"Problem creating entry {entry_data.name} in file source {entry_data.target}", exc_info=True)
            raise
        except Exception:
            message = f"Problem creating entry {entry_data.name} in file source {entry_data.target}"
            log.warning(message, exc_info=True)