diff --git a/CHANGES/+add-pulp-exceptions.feature b/CHANGES/+add-pulp-exceptions.feature new file mode 100644 index 0000000..b0fd643 --- /dev/null +++ b/CHANGES/+add-pulp-exceptions.feature @@ -0,0 +1 @@ +Add more Pulp Exceptions. diff --git a/pulp_npm/app/exceptions.py b/pulp_npm/app/exceptions.py new file mode 100644 index 0000000..e69de29 diff --git a/pulp_npm/app/tasks/synchronizing.py b/pulp_npm/app/tasks/synchronizing.py index e09389b..fee03e6 100644 --- a/pulp_npm/app/tasks/synchronizing.py +++ b/pulp_npm/app/tasks/synchronizing.py @@ -2,6 +2,7 @@ import logging from gettext import gettext as _ +from pulpcore.plugin.exceptions import SyncError from pulpcore.plugin.models import Artifact, Remote, Repository from pulpcore.plugin.serializers import RepositoryVersionSerializer from pulpcore.plugin.stages import ( @@ -35,7 +36,7 @@ def synchronize(remote_pk, repository_pk, mirror=False): repository = Repository.objects.get(pk=repository_pk) if not remote.url: - raise ValueError(_("A remote must have a url specified to synchronize.")) + raise SyncError(_("A remote must have a url specified to synchronize.")) # Interpret policy to download Artifacts or not deferred_download = remote.policy != Remote.IMMEDIATE diff --git a/pyproject.toml b/pyproject.toml index e4b9418..aac1ab0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ classifiers=[ ] requires-python = ">=3.11" dependencies = [ - "pulpcore>=3.85.0,<3.115", + "pulpcore>=3.105.0,<3.115", ] [project.urls]