From f04964c696336f5699a099bbd64785f199d91f4c Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sun, 10 Aug 2014 09:22:29 +0200 Subject: spi/nrf24l01/uart: Use ChannelError exception. Rename the old MissingDataError to the clearer ChannelError. Also, add ChannelError in the UART decoder. --- decoders/uart/pd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'decoders/uart/pd.py') diff --git a/decoders/uart/pd.py b/decoders/uart/pd.py index fef3aa5..d13a119 100644 --- a/decoders/uart/pd.py +++ b/decoders/uart/pd.py @@ -70,6 +70,9 @@ def parity_ok(parity_type, parity_bit, data, num_data_bits): class SamplerateError(Exception): pass +class ChannelError(Exception): + pass + class Decoder(srd.Decoder): api_version = 2 id = 'uart' @@ -336,7 +339,7 @@ class Decoder(srd.Decoder): # Either RX or TX (but not both) can be omitted. has_pin = [rx in (0, 1), tx in (0, 1)] if has_pin == [False, False]: - raise Exception('Either TX or RX (or both) pins required.') + raise ChannelError('Either TX or RX (or both) pins required.') # State machine. for rxtx in (RX, TX): -- cgit v1.2.3-70-g09d2