File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 1+ import json
12import logging
23import requests
34import time
@@ -83,9 +84,16 @@ def wait_till_done(self, timeout_seconds: int = 300) -> None:
8384 def errors (self ) -> Optional [Dict [str , Any ]]:
8485 """ Fetch the error associated with an import task.
8586 """
87+ if self .type == "add-data-rows-to-batch" or self .type == "send-to-task-queue" :
88+ if self .status == "FAILED" :
89+ # for these tasks, the error is embedded in the result itself
90+ return json .loads (self .result_url )
91+ return None
92+
8693 # TODO: We should handle error messages for export v2 tasks in the future.
8794 if self .name != 'JSON Import' :
8895 return None
96+
8997 if self .status == "FAILED" :
9098 result = self ._fetch_remote_json ()
9199 return result ["error" ]
You can’t perform that action at this time.
0 commit comments