Skip to content

Commit 91c23fa

Browse files
committed
Append device representation to the TypeError
1 parent 1965df9 commit 91c23fa

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` instance")
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)