Skip to content

Commit dd514b8

Browse files
Handle additional errors when downloading a timeseries
1 parent 7720dae commit dd514b8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/timeseries2csv.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import pytz
2222
from dateutil.relativedelta import relativedelta
2323

24-
from rctclient.exceptions import FrameCRCMismatch
24+
from rctclient.exceptions import FrameCRCMismatch, FrameLengthExceeded, InvalidCommand
2525
from rctclient.frame import ReceiveFrame, make_frame
2626
from rctclient.registry import REGISTRY as R
2727
from rctclient.types import Command, DataType
@@ -229,6 +229,12 @@ def timeseries2csv(host: str, port: int, output: Optional[str], header_format: b
229229
except FrameCRCMismatch:
230230
cprint('\tCRC error')
231231
break
232+
except FrameLengthExceeded:
233+
cprint('\tFrame length exceeded')
234+
break
235+
except InvalidCommand:
236+
cprint('\tInvalid command')
237+
break
232238
if rframe.complete():
233239
break
234240
else:

0 commit comments

Comments
 (0)