Error-handling facilities.
parselglossy.exceptions.
Error
[source]¶Bases: parselglossy.exceptions.Error
Detailed error reporting for dictionaries.
address
¶The keys needed to access the offending element in the dict.
Type: | Tuple |
---|
message
¶The error message.
Type: | str |
---|
Notes
As we need to support Python < 3.6, we cannot use the defaults field of namedtuple.
parselglossy.exceptions.
ParselglossyError
[source]¶Bases: Exception
Exception raised when parsing fails.
parselglossy.exceptions.
collate_errors
(*, when: str, errors: List[parselglossy.exceptions.Error]) → str[source]¶Collate a list of error into an informative message.
Parameters: |
|
---|---|
Returns: | msg – An error message with details about where in the dictionary the error arose and what the error is. For example: Error(s) occurred when fixing defaults:
- At 'user['scf']['another_number']'
KeyError 'min_num_iterations' in closure
'user['scf']['min_num_iterations'] / 2'
|
Return type: | str |