Skip to content

Commit

Permalink
Include the row number in the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Sep 25, 2023
1 parent c3d0f2c commit d2a6827
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pyxform/xls2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,10 @@ def workbook_to_json(
new_dict["control"] = new_dict.get("control", {})
new_dict["control"].update({"intent": app_package_name})
else:
raise PyXFormError("Invalid Android package name format.")
raise PyXFormError(
(ROW_FORMAT_STRING % row_number)
+ " Invalid Android package name format."
)

parent_children_array.append(new_dict)
continue
Expand Down
2 changes: 1 addition & 1 deletion tests/test_image_app_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_throwing_error_when_invalid_android_package_name_is_used(self):
| | type | name | label | parameters | appearance |
| | image | my_image | Image | app=something | {case} |
"""
error__contains = (["Invalid Android package name format"],)
error__contains = (["[row = 2] Invalid Android package name format"],)
for case in appearances:
with self.subTest(msg=case):
self.assertPyxformXform(
Expand Down

0 comments on commit d2a6827

Please sign in to comment.