Django Cant Cant Catch error from pandas dataframe

Я пытаюсь поймать ошибку, которая отображается в шаблоне, где сказано:

ArrowTypeError at /user_area/absent/2840 Atlantic Ave/
("Expected bytes, got a 'int' object", 'Conversion failed for column ZipCode with type object')
Request Method: GET
Request URL:    http://127.0.0.1:8000/user_area/absent/2840%20Atlantic%20Ave/
Django Version: 3.2.12
Exception Type: ArrowTypeError
Exception Value:    
("Expected bytes, got a 'int' object", 'Conversion failed for column ZipCode with type object')
Exception Location: pyarrow/error.pxi, line 122, in pyarrow.lib.check_status

мой код выглядит так:

  try:
      return pd.read_feather(os.path.join(cache_folder, file))
  except Exception as e:
      print(e)
      return get_api_info(request_items, url_requested, now)

Я хочу, чтобы как только возникнет ошибка ArrowTypeError, Except возвращал get_api_info(). Есть ли способ сделать это? спасибо

Вернуться на верх