Skip to content

Commit

Permalink
refactor: raise textfsm exception from base scrapli exception
Browse files Browse the repository at this point in the history
  • Loading branch information
carlmontanari committed Sep 16, 2024
1 parent 9f5d9d0 commit 992a5bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scrapli/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 []


Expand Down

0 comments on commit 992a5bb

Please sign in to comment.