Skip to content

Commit 22771e4

Browse files
committed
Update dummy viewer to produce correct errors
1 parent 76f5fe9 commit 22771e4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/astro_image_display_api/dummy_viewer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def get_stretch(self, image_label: str | None = None) -> BaseStretch:
127127

128128
def set_stretch(self, value: BaseStretch, image_label: str | None = None) -> None:
129129
if not isinstance(value, BaseStretch):
130-
raise ValueError(f"Stretch option {value} is not valid. Must be an Astropy.visualization Stretch object.")
130+
raise TypeError(f"Stretch option {value} is not valid. Must be an Astropy.visualization Stretch object.")
131131
image_label = self._resolve_image_label(image_label)
132132
if image_label not in self._images:
133133
raise ValueError(f"Image label '{image_label}' not found. Please load an image first.")
@@ -145,7 +145,7 @@ def set_cuts(self, value: tuple[numbers.Real, numbers.Real] | BaseInterval, imag
145145
elif isinstance(value, BaseInterval):
146146
self._cuts = value
147147
else:
148-
raise ValueError("Cuts must be an Astropy.visualization Interval object or a tuple of two values.")
148+
raise TypeError("Cuts must be an Astropy.visualization Interval object or a tuple of two values.")
149149
image_label = self._resolve_image_label(image_label)
150150
if image_label not in self._images:
151151
raise ValueError(f"Image label '{image_label}' not found. Please load an image first.")
@@ -498,7 +498,7 @@ def remove_catalog(self, catalog_label: str | None = None) -> None:
498498
then all markers will be removed.
499499
"""
500500
if isinstance(catalog_label, list):
501-
raise ValueError(
501+
raise TypeError(
502502
"Cannot remove multiple catalogs from a list. Please specify "
503503
"a single catalog label or use '*' to remove all catalogs."
504504
)

0 commit comments

Comments
 (0)