Skip to content

Commit 65d7146

Browse files
authored
Merge pull request #292 from ederag/quotes
Improve error message when a wrong type is passed to `Spectrometer`
2 parents 770a9c7 + 91c23fa commit 65d7146

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/seabreeze/spectrometers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ def __init__(self, device: SeaBreezeDevice) -> None:
112112
a SeaBreezeDevice as returned from `list_devices`
113113
"""
114114
if not isinstance(device, self._backend.SeaBreezeDevice):
115-
raise TypeError("device has to be a `SeaBreezeDevice`")
115+
raise TypeError(
116+
f"`device` has to be a `SeaBreezeDevice` instance, got {device!r}"
117+
)
116118
self._dev = device
117119
self.open() # always open the device here to allow caching values
118120

0 commit comments

Comments
 (0)