@@ -84,7 +84,12 @@ def push_project_async(mc, directory):
84
84
mp .log .info ("--- version: " + mc .user_agent_info ())
85
85
mp .log .info (f"--- start push { project_path } " )
86
86
87
- server_info = mc .project_info (project_path )
87
+ try :
88
+ server_info = mc .project_info (project_path )
89
+ except ClientError as err :
90
+ mp .log .error ("Error getting project info: " + str (err ))
91
+ mp .log .info ("--- push aborted" )
92
+ raise
88
93
server_version = server_info ["version" ] if server_info ["version" ] else "v0"
89
94
90
95
mp .log .info (f"got project info: local version { local_version } / server version { server_version } " )
@@ -122,7 +127,12 @@ def push_project_async(mc, directory):
122
127
"changes" : changes
123
128
}
124
129
125
- resp = mc .post (f'/v1/project/push/{ project_path } ' , data , {"Content-Type" : "application/json" })
130
+ try :
131
+ resp = mc .post (f'/v1/project/push/{ project_path } ' , data , {"Content-Type" : "application/json" })
132
+ except ClientError as err :
133
+ mp .log .error ("Error starting transaction: " + str (err ))
134
+ mp .log .info ("--- push aborted" )
135
+ raise
126
136
server_resp = json .load (resp )
127
137
128
138
upload_files = data ['changes' ]["added" ] + data ['changes' ]["updated" ]
@@ -181,6 +191,8 @@ def push_project_is_running(job):
181
191
"""
182
192
for future in job .futures :
183
193
if future .done () and future .exception () is not None :
194
+ job .mp .log .error ("Error while pushing data: " + str (future .exception ()))
195
+ job .mp .log .info ("--- push aborted" )
184
196
raise future .exception ()
185
197
if future .running ():
186
198
return True
@@ -205,6 +217,8 @@ def push_project_finalize(job):
205
217
# make sure any exceptions from threads are not lost
206
218
for future in job .futures :
207
219
if future .exception () is not None :
220
+ job .mp .log .error ("Error while pushing data: " + str (future .exception ()))
221
+ job .mp .log .info ("--- push aborted" )
208
222
raise future .exception ()
209
223
210
224
if job .transferred_size != job .total_size :
@@ -256,6 +270,6 @@ def _do_upload(item, job):
256
270
""" runs in worker thread """
257
271
if job .is_cancelled :
258
272
return
259
-
273
+
260
274
item .upload_blocking (job .mc , job .mp )
261
275
job .transferred_size += item .size
0 commit comments