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 []