Commit f2da031
authored
fix: include traceback in admin error notifications (#78)
- error_logger: use exc_info=context.error instead of logger.exception()
so the traceback is pulled from the exception's __traceback__ directly
rather than sys.exc_info() which may be empty in PTB's error handler
- TelegramLogHandler.format: truncate long tracebacks to stay within
Telegram's 4096 char limit (with '[truncated]' notice)
- TelegramLogHandler.emit: wrap in try/except so send_message failures
don't cascade silently and swallow the log record
- Remove redundant logger.warning line that only showed empty context1 parent 5e72ea1 commit f2da031
1 file changed
Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
64 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
| |||
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
101 | | - | |
102 | | - | |
| 108 | + | |
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
| |||
0 commit comments