Skip to content

Commit

Permalink
Minor changes to view-portal-object utility script.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Aug 23, 2024
1 parent f424018 commit 42b8dfd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ dcicutils
Change Log
----------

8.14.4
======

* Minor changes to view-portal-object utility script.


8.14.3
======

Expand Down
7 changes: 6 additions & 1 deletion dcicutils/scripts/view_portal_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,12 @@ def write_insert_files(response: dict) -> None:
path = f"/{uuid}"
else:
path = uuid
response = portal.get(path, raw=raw or inserts, database=database)
if (response := portal.get(path, raw=raw or inserts, database=database)) is not None:
if response.status_code == 403:
_exit(f"Permission error getting Portal object from {portal.server}: {uuid}")
elif response.status_code == 404:
_exit(f"Not found Portal object from {portal.server}: {uuid}")

except Exception as e:
if "404" in str(e) and "not found" in str(e).lower():
_print(f"Portal object not found at {portal.server}: {uuid}")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dcicutils"
version = "8.14.3"
version = "8.14.3.1b1" # TODO: To become 8.14.4
description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources"
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 42b8dfd

Please sign in to comment.