exceptions.py 409 B

1234567891011121314151617
  1. """
  2. Exception Handle Functions
  3. """
  4. async def handle_spider_exception(log_client, error, traceback, trace_id, task_name):
  5. await log_client.log(
  6. contexts={
  7. "data": {
  8. "error": error,
  9. "traceback": traceback,
  10. },
  11. "trace_id": trace_id,
  12. "message": "爬虫接口请求失败",
  13. "task": task_name,
  14. }
  15. )