code: def handle_exchange_error(exchange, e):
      try:
          message = "{}: {}".format(
              e.__class__, e.message.decode("ascii", "ignore")
          )
      except Exception:
          message = "unexpected error"
  
      folder = get_exchange_folder(exchange.name)
      filename = os.path.join(folder, "blacklist.txt")
      with open(filename, "wt") as handle:
          handle.write(message)
  
file_path: catalyst/catalyst/exchange/utils/test_utils.py
imports: import os
  import random
  import tempfile
  from catalyst.assets._assets import TradingPair
  from catalyst.exchange.exchange_bundle import ExchangeBundle
  from catalyst.exchange.utils.exchange_utils import get_exchange_folder
  from catalyst.exchange.utils.factory import find_exchanges
  from catalyst.utils.paths import ensure_directory
label_desc: Use image node_id 1 for calling a global function with example usage: handle_exchange_error(exchange, e) without return types