Print errors if creds aren't correct

This commit is contained in:
Kibzik
2023-06-07 18:38:02 +03:00
parent e1e3a01da4
commit e70746c6f1

View File

@@ -65,8 +65,10 @@ def callback(ch, method, properties, body: bytes, main_logger: logging.Logger, l
# print(f"Active threads: {active_count()}.")
except Exception as exc:
if hasattr(exc, "message"):
print(f"{sys.exc_info()[0]}: {exc.message}")
main_logger.error(f"{sys.exc_info()[0]}: {exc.message}")
else:
print(f"{sys.exc_info()[0]}: {str(exc)}")
main_logger.error(f"{sys.exc_info()[0]}: {str(exc)}")
finally:
pass