Open
Description
Implement Safe File and Plist Handling Functions
Context
Currently, artifact modules handle file opening and plist parsing directly, without consistent error handling. This can lead to module failures that stop the execution of the entire artifact when encountering issues.
Proposal
Implement two new utility functions in ilapfuncs.py
:
get_file_content(file_path, binary_mode=False, encoding=None)
get_plist_content(file_path)
These functions will encapsulate file opening and plist parsing operations with proper error handling.
Benefits
- Improved error handling and logging across all artifact modules
- Simplified code in individual artifact modules
- Consistent behavior when encountering file access or parsing issues
- Easier maintenance and updates to error handling logic
Implementation Details
See attached ADR for full implementation details of both functions.
Discussion Points
- Are there any other parameters needed for these functions?
- Should we consider any additional error cases?
- How should we approach updating existing modules to use these new functions?
Please review and provide feedback on this proposal.
Metadata
Metadata
Assignees
Labels
No labels
Activity