-
Notifications
You must be signed in to change notification settings - Fork 84
Commit 0290d94
repository/IMAP: handle errors reading remotepassfile gracefully
Replace the bare open()/close() pattern with a context manager and
wrap I/O and encoding failures in OfflineImapError so the user gets
a clear, actionable message instead of a raw Python exception.
Before this change, a missing, unreadable, or non-UTF-8 password
file would surface as an unhandled FileNotFoundError, PermissionError
or UnicodeDecodeError with no indication of which repository was
affected.
The new error message includes the expanded file path and the
repository name:
Unable to read remotepassfile '/path/to/pass' for repository 'Name': ...
Closes: #248 1 parent b03c565 commit 0290d94
1 file changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
620 | 620 | | |
621 | 621 | | |
622 | 622 | | |
623 | - | ||
624 | - | ||
625 | - | ||
626 | - | ||
623 | + | ||
624 | + | ||
625 | + | ||
626 | + | ||
627 | + | ||
628 | + | ||
629 | + | ||
630 | + | ||
631 | + | ||
632 | + | ||
627 | 633 | | |
628 | 634 | | |
629 | 635 | | |
| |||
0 commit comments