This is an automated email from the ASF dual-hosted git repository.

rkk pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/sdap-nexus.git


The following commit(s) were added to refs/heads/develop by this push:
     new 955c359  Error handling on ds listing for zarr (#320)
955c359 is described below

commit 955c3599f9868db488916989b69e2770e907bfa4
Author: Riley Kuttruff <[email protected]>
AuthorDate: Mon Aug 19 09:12:43 2024 -0700

    Error handling on ds listing for zarr (#320)
    
    Co-authored-by: rileykk <[email protected]>
---
 CHANGELOG.md                                    |  9 +++++++++
 data-access/nexustiles/backends/zarr/backend.py | 21 +++++++++++++--------
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index ca865a9..c244d82 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this 
file.
 The format is based on [Keep a 
Changelog](https://keepachangelog.com/en/1.0.0/),
 and this project adheres to [Semantic 
Versioning](https://semver.org/spec/v2.0.0.html).
 
+## [Unreleased] - Unreleased
+### Added
+### Changed
+### Deprecated
+### Removed
+### Fixed
+- SDAP-525: Fixed expired AWS creds for Zarr datasets breaking list endpoint
+### Security
+
 ## [1.3.0] - 2024-06-10
 ### Added
 - SDAP-506:
diff --git a/data-access/nexustiles/backends/zarr/backend.py 
b/data-access/nexustiles/backends/zarr/backend.py
index 2cf91e5..b055b08 100644
--- a/data-access/nexustiles/backends/zarr/backend.py
+++ b/data-access/nexustiles/backends/zarr/backend.py
@@ -123,14 +123,19 @@ class ZarrBackend(AbstractTileService):
         }
 
         if not simple:
-            min_date = self.get_min_time([])
-            max_date = self.get_max_time([])
-            ds['start'] = min_date
-            ds['end'] = max_date
-            ds['iso_start'] = 
datetime.utcfromtimestamp(min_date).strftime(ISO_8601)
-            ds['iso_end'] = 
datetime.utcfromtimestamp(max_date).strftime(ISO_8601)
-
-            ds['metadata'] = dict(self.__ds.attrs)
+            try:
+                min_date = self.get_min_time([])
+                max_date = self.get_max_time([])
+                ds['start'] = min_date
+                ds['end'] = max_date
+                ds['iso_start'] = 
datetime.utcfromtimestamp(min_date).strftime(ISO_8601)
+                ds['iso_end'] = 
datetime.utcfromtimestamp(max_date).strftime(ISO_8601)
+
+                ds['metadata'] = dict(self.__ds.attrs)
+            except Exception as e:
+                logger.error(f'Failed to access dataset for {self._name}. 
Cause: {e}')
+                ds['error'] = "Dataset is currently unavailable"
+                ds['error_reason'] = str(e)
 
         return [ds]
 

Reply via email to