fix(parser): log channel arg to avoid UnboundLocalError

Use the original `channel` argument in the error log instead of
`prepared_channel_id` to prevent an UnboundLocalError when an
exception is raised during post parsing.
This commit is contained in:
vvzvlad
2026-05-17 22:30:01 +03:00
parent 6e2c1f79d3
commit 705310da28
+2 -2
View File
@@ -110,8 +110,8 @@ class PostParser:
return None
except Exception as e:
# Log the specific exception type and message
logger.error(f"post_parsing_error: channel {prepared_channel_id}, post_id {post_id}, error_type {type(e).__name__}, error_message {str(e)}")
# Log the specific exception type and message (use original channel arg to avoid UnboundLocalError)
logger.error(f"post_parsing_error: channel {channel}, post_id {post_id}, error_type {type(e).__name__}, error_message {str(e)}")
# Optional: include traceback for more detail
# import traceback
# logger.error(traceback.format_exc())