Commit c27e71f7 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Raise ValueError if frequency not accepted

parent 954d6a4f
......@@ -118,7 +118,8 @@ class CamrasHpibDevice(object):
freq (Union[float, Quantity]): new frequency. If no unit present, assume Hz
Raises:
RuntimeError: If the device sticks to a different frequency (e.g. if the specified
RuntimeError: On communication error
ValueError: If the device sticks to a different frequency (e.g. if the specified
frequency is outside the accepted range for the device)
"""
if isinstance(freq, Quantity):
......@@ -127,7 +128,7 @@ class CamrasHpibDevice(object):
new_freq = self.frequency
if self._check_frequency and new_freq.to(u.Hz).value != int(freq):
raise RuntimeError("Setting frequency failed: tried to set to {}, it is now {}".format(
raise ValueError("Setting frequency failed: tried to set to {}, it is now {}".format(
freq, new_freq))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment