prefer-exception-propagation
Propagate exceptions instead of replacing them with message-only generic errors.
Why
Catching an exception only to copy its text into a generic error loses the original error type and adds a handler without recovery or additional context. Callers then cannot classify the original failure.
Fix
Remove the message-only handler and let the original exception propagate. Preserve intentional public exception contracts, privacy, retries and cleanup. Keep an explained exact-code exception when the generic exception type is an intentional boundary contract.
Examples
try: send()except (OSError, ValueError): message = "Request failed" raise SystemExit(message) from Nonesend()try: send()except Exception as error: raise RuntimeError(str(error)) from errorsend()