Skip to content

Commit e6adc89

Browse files
author
Laurent PINSON
committed
switched to JsonPathParserError
1 parent 4ff7aa1 commit e6adc89

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

JSONLibrary/JSONLibraryKeywords.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from robot.utils.asserts import assert_true, fail
88
from jsonpath_ng import Index, Fields
99
from jsonpath_ng.ext import parse as parse_ng
10+
from jsonpath_ng.exceptions import JsonPathParserError
1011
from .version import VERSION
1112

1213
__author__ = 'Traitanit Huangsri'
@@ -16,8 +17,9 @@
1617
def parse(json_path):
1718
try:
1819
_rv=parse_ng(json_path)
19-
except BaseException as e:
20+
except JsonPathParserError as e:
2021
fail("Parser failed to undestand syntax '{}'. error message: \n{}\n\nYou may raise an issue on https://github.com/h2non/jsonpath-ng".format(json_path,e))
22+
# let other exceptions crash robot
2123
return _rv
2224

2325

0 commit comments

Comments
 (0)