Skip to content

Commit

Permalink
db: Updatd error checking logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Somerandomguy10111 committed Feb 17, 2025
1 parent 788a7a5 commit 49d982d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xrdpattern/pattern/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ def load(cls, dirpath : str,
xrd_datas = parser.extract(fpath=fpath, csv_orientation=csv_orientation)
[db._add_data(info=info, fpath=fpath, strict=strict) for info in xrd_datas]
except Exception as e:
patterdb_logger.warning(f'Failed to parse file {fpath}:\n- Reason: {e.__repr__()}')
err_msg = f'Failed to parse file {fpath}:\n- Reason: {e.__repr__()}'
if strict:
raise e
raise ValueError(err_msg)
else:
patterdb_logger.warning(err_msg)

if not limit_patterns is None:
if len(db.patterns) >= limit_patterns:
Expand Down

0 comments on commit 49d982d

Please sign in to comment.