14 lines
380 B
Python
14 lines
380 B
Python
import logging
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
class ErrorHandler:
|
|
@staticmethod
|
|
def handle_communication_error(error: Exception, context: str = ""):
|
|
"""
|
|
Handle communication errors with proper logging
|
|
"""
|
|
error_msg = f"Communication error in {context}: {str(error)}"
|
|
logger.error(error_msg)
|
|
return error_msg
|