Skip to content

Commit

Permalink
cubeviz spectral extraction: send exceptions to snackbar (spacetelesc…
Browse files Browse the repository at this point in the history
…ope#2807)

* send exceptions to snackbar
* still should aim to *prevent* errors by disabling the button, whenever possible, but this can catch any remaining exceptions instead of burying them.
* changelog entry
  • Loading branch information
kecnry authored Apr 17, 2024
1 parent b0ec4c1 commit 4d76fda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ Bug Fixes
Cubeviz
^^^^^^^

- Spectral extraction errors will show in snackbar. [#2807]

Imviz
^^^^^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,12 @@ def get_aperture(self):
return mask_weights

def vue_spectral_extraction(self, *args, **kwargs):
self.collapse_to_spectrum(add_data=True)
try:
self.collapse_to_spectrum(add_data=True)
except Exception as e:
self.hub.broadcast(SnackbarMessage(
f"Extraction failed: {repr(e)}",
sender=self, color="error"))

def vue_save_as_fits(self, *args):
self._save_extracted_spec_to_fits()
Expand Down

0 comments on commit 4d76fda

Please sign in to comment.