Added try/except blocks around read operations of external files. These are meant to catch any Unicode-related exceptions thrown while reading these files (e.g., the file contains an invalid UTF-8 sequence), providing more robust code. The except clauses will log a message pointing to the file that causes the exception. External files include:
C++ source file being processed
The filefilter.txt file
Rule Python script files
These modifications were made because NsiqCppStyle often failed to read external files, due to encoding issues in the source files (e.g., invalid UTF-8 sequences, incorrect UTF16 encoding). I was often left puzzling over which file had the invalid sequence. With the try/except blocks, the user is told which file is problematic.
Added try/except blocks around read operations of external files. These are meant to catch any Unicode-related exceptions thrown while reading these files (e.g., the file contains an invalid UTF-8 sequence), providing more robust code. The except clauses will log a message pointing to the file that causes the exception. External files include:
These modifications were made because NsiqCppStyle often failed to read external files, due to encoding issues in the source files (e.g., invalid UTF-8 sequences, incorrect UTF16 encoding). I was often left puzzling over which file had the invalid sequence. With the try/except blocks, the user is told which file is problematic.