Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRosenstein authored Aug 19, 2024
1 parent 3aed1a0 commit a338247
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kraken-build/src/kraken/std/cargo/tasks/cargo_publish_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def prepare(self) -> TaskStatus | None:
return self._check_package_existence(package_name, version, self.registry.get())
except Exception as e:
logger.warn(
f"An error happened while checking for {package_name} existence in {self.registry.get().alias}, {e}",
"An error happened while checking for {} existence in %s, %s",
package_name,
self.registry.get().alias,
e,
)
return TaskStatus.pending("Unable to verify package existence")

Expand Down Expand Up @@ -194,7 +197,7 @@ def _check_package_existence(cls, package_name: str, version: str, registry: Car
index_response = session.get(f"{index}/{index_path}")

if index_response.status_code in [404, 410, 451]:
return TaskStatus.pending("Package {package_name} does not already exists in {registry.alias}")
return TaskStatus.pending(f"Package {package_name} does not already exists in {registry.alias}")
elif index_response.status_code % 200 != 0:
logger.warn(index_response.text)
return TaskStatus.pending("Unable to verify package existence - error when fetching package information")
Expand Down

0 comments on commit a338247

Please sign in to comment.