From 992a5bb6685966bdc269bb3c0f808042fe57562b Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Mon, 16 Sep 2024 05:30:49 -0700 Subject: [PATCH] refactor: raise textfsm exception from base scrapli exception --- scrapli/helper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scrapli/helper.py b/scrapli/helper.py index f62d27c1..bd70e34c 100644 --- a/scrapli/helper.py +++ b/scrapli/helper.py @@ -10,7 +10,7 @@ from typing import Any, Dict, List, Optional, TextIO, Tuple, Union from warnings import warn -from scrapli.exceptions import ScrapliValueError +from scrapli.exceptions import ScrapliException, ScrapliValueError from scrapli.logging import logger from scrapli.settings import Settings @@ -137,10 +137,10 @@ def textfsm_parse( structured_output=structured_output, header=re_table.header ) return structured_output - except textfsm.parser.TextFSMError: + except textfsm.parser.TextFSMError as exc: logger.warning("failed to parse data with textfsm") if raise_err: - raise + raise ScrapliException(exc) from exc return []