Skip to content

Commit

Permalink
Catch TOMLDecodeError
Browse files Browse the repository at this point in the history
  • Loading branch information
WangGithubUser committed Oct 4, 2023
1 parent 58f2492 commit e93dc27
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions client/configuration/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,10 @@ def create_search_paths(
LOG.warning(f"Unrecognized configuration item: {unrecognized_key}")

return partial_configuration
except json.JSONDecodeError as error:
raise exceptions.InvalidConfiguration("Invalid JSON file") from error
except (json.JSONDecodeError, tomli.TOMLDecodeError) as error:
raise exceptions.InvalidConfiguration(
f'Invalid {"TOML" if is_pyproject_dot_toml else "JSON"} file'
) from error

@staticmethod
def from_file(
Expand Down

0 comments on commit e93dc27

Please sign in to comment.