use subclassed Exception
This commit is contained in:
parent
0f68796831
commit
a3773df853
@ -10,6 +10,10 @@ from .main import Map, Device
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class G85Error(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
# Hack to directly pass through <![CDATA[...]]>
|
# Hack to directly pass through <![CDATA[...]]>
|
||||||
def _escape_cdata(text):
|
def _escape_cdata(text):
|
||||||
if text.startswith('<![CDATA[') and text.endswith(']]>'):
|
if text.startswith('<![CDATA[') and text.endswith(']]>'):
|
||||||
@ -64,7 +68,7 @@ def write_devices(devices: Sequence[Device], el_map: ElementTree.Element) -> Non
|
|||||||
|
|
||||||
# Row data prep
|
# Row data prep
|
||||||
if device.map is None:
|
if device.map is None:
|
||||||
raise Exception(f'No _data for device pformat({device})')
|
raise G85Error(f'No _data for device pformat({device})')
|
||||||
|
|
||||||
is_decimal = device.BinType == 'Decimal'
|
is_decimal = device.BinType == 'Decimal'
|
||||||
row_texts, bin_length = prepare_data(device.map, decimal=is_decimal)
|
row_texts, bin_length = prepare_data(device.map, decimal=is_decimal)
|
||||||
|
Loading…
Reference in New Issue
Block a user