File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 4
4
import tracemalloc
5
5
6
6
import psutil
7
- from huggingface_hub .utils import GatedRepoError
7
+ from huggingface_hub .errors import GatedRepoError , HfHubHTTPError
8
8
from unitxt .loaders import MissingKaggleCredentialsError
9
9
from unitxt .logging_utils import get_logger
10
10
from unitxt .settings_utils import get_constants , get_settings
@@ -76,7 +76,18 @@ def test_preparations(self):
76
76
)
77
77
continue
78
78
self .assertTrue (False )
79
- raise
79
+ raise e
80
+ except Exception as e :
81
+ current_exception = e
82
+ import requests
83
+ while current_exception :
84
+ if isinstance (current_exception , (requests .exceptions .ReadTimeout , HfHubHTTPError )):
85
+ logger .error (f"Connection error occurred in { file } . Error: { e } ." )
86
+ break
87
+ current_exception = current_exception .__cause__ or current_exception .__context__
88
+ else :
89
+ raise e
90
+
80
91
logger .info (f"Testing preparation file: { file } passed" )
81
92
self .assertTrue (True )
82
93
You can’t perform that action at this time.
0 commit comments