code: def _error_callback(ws_app: WebSocketApp, error: Exception):
      errors = {
          KeyError: "Malformed log message, missing key",
          JSONDecodeError: "Malformed log message",
          TypeError: "Malformed log format",
          ValueError: "Malformed date format",
      }
      logger.error(
          f"⚡ Error while reading logs ({errors.get(type(error), 'Unknown')}), {error}"
      )
      ws_app.close()
  
file_path: pytorch-lightning/src/lightning/app/utilities/log_helpers.py
imports: from dataclasses import dataclass
  from datetime import datetime
  from json import JSONDecodeError
  from websocket import WebSocketApp
  from lightning.app.utilities.app_helpers import Logger
label_desc: Use image node_id 1 for calling a global function with example usage: _error_callback(ws_app, error) without return types