-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(errors): centralize validation error messages for better mai…
…ntainability - Added specific error messages for filename, version, environment variables, and class/attribute mismatches. - Enhanced clarity and reusability of validation errors in SpyModel. - Organized errors for SpyModel validation, including environment and variable mismatches
- Loading branch information
1 parent
18b57be
commit 035e5ca
Showing
2 changed files
with
38 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
class Errors: | ||
|
||
|
||
ANALYSIS_RECURSION_WARNING = ("Warning: You cannot analyze the code that itself handles analysis, as this may result " | ||
"in uncontrolled deep recursion. To avoid potential performance issues or stack overflow " | ||
"errors, ensure that the analysis process does not recursively attempt to evaluate itself.") | ||
"errors, ensure that the analysis process does not recursively attempt to evaluate itself.") | ||
|
||
### Spy model validation | ||
FILENAME_MISMATCH = "Filename mismatch: {0} != {1}" | ||
VERSION_MISMATCH = "Version mismatch: {0} != {1}" | ||
ENV_VAR_MISMATCH = "Value mismatch for environment variable '{0}': expected '{1}', found '{2}'." | ||
ENV_VAR_MISSING = "Missing environment variable: '{0}'. Ensure it is defined in the system." | ||
VAR_MISMATCH = "Value mismatch for variable '{0}': expected '{1}', found '{2}'" | ||
VAR_MISSING = "Missing variable: '{0}'. Ensure it is defined." | ||
GENERIC_FUNCTIONS_MISMATCH = "Functions mismatch: Some functions are not defined." | ||
CLASS_MISSING = "Missing class: {0} Ensure it is defined." | ||
GENERIC_CLASS_ATTRIBUTES_MISMATCH = "Class attributes mismatch in Class {0}: some attributes are not defined in the class {0}." | ||
GENERIC_INSTANCE_ATTRIBUTES_MISMATCH = "Instance attributes mismatch in Class {0}: some attributes are not defined in the __init__ method of the class {0}." | ||
GENERIC_CLASS_METHODS_MISMATCH = "Methods mismatch in Class {0}: some attributes are not defined in the class {0}." | ||
GENERIC_CLASS_SUPERCLASSES_MISMATCH = "Superclass mismatch in Class: {0} some superclasses are not defined in the class {0}." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters