Fix error handling by raising ReadWriteMemoryError in multiple method…#33
Fix error handling by raising ReadWriteMemoryError in multiple method…#33MillhioreBT wants to merge 1 commit intovsantiago113:masterfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes error handling in the ReadWriteMemory library by properly raising exceptions instead of just creating them. The change addresses a bug where ReadWriteMemoryError instances were being created but not raised, causing errors to be silently ignored.
- Adds
raisekeyword before ReadWriteMemoryError instantiation in all exception handling blocks - Fixes error propagation in 8 memory operation methods (read, write, and their variants)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| error = {'msg': str(error), 'Handle': self.handle, 'PID': self.pid, | ||
| 'Name': self.name, 'ErrorCode': self.error_code} | ||
| ReadWriteMemoryError(error) | ||
| raise ReadWriteMemoryError(error) |
There was a problem hiding this comment.
The ReadWriteMemoryError constructor appears to expect a string message, but a dictionary is being passed. This will likely result in an unhelpful error representation. Consider passing error['msg'] instead of the entire error dictionary, or update the exception class to properly handle dictionary input.
No description provided.