You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2026. It is now read-only.
Copy file name to clipboardExpand all lines: src/resumable-upload.ts
+23-24Lines changed: 23 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -742,9 +742,18 @@ export class Upload extends Writable {
742
742
responseReceived=true;
743
743
this.responseHandler(resp);
744
744
}
745
-
}catch(err){
746
-
conste=errasError;
747
-
this.destroy(e);
745
+
}catch(e){
746
+
consterr=easApiError;
747
+
748
+
if(this.retryOptions.retryableErrorFn!(err)){
749
+
this.attemptDelayedRetry({
750
+
status: NaN,
751
+
data: err,
752
+
});
753
+
return;
754
+
}
755
+
756
+
this.destroy(err);
748
757
}
749
758
}
750
759
@@ -833,7 +842,16 @@ export class Upload extends Writable {
833
842
}
834
843
this.offset=0;
835
844
}catch(e){
836
-
consterr=easGaxiosError;
845
+
consterr=easApiError;
846
+
847
+
if(this.retryOptions.retryableErrorFn!(err)){
848
+
this.attemptDelayedRetry({
849
+
status: NaN,
850
+
data: err,
851
+
});
852
+
return;
853
+
}
854
+
837
855
this.destroy(err);
838
856
}
839
857
}
@@ -899,25 +917,6 @@ export class Upload extends Writable {
899
917
returnsuccessfulRequest ? res : null;
900
918
}
901
919
902
-
privaterestart(){
903
-
if(this.numBytesWritten){
904
-
constmessage=
905
-
'Attempting to restart an upload after unrecoverable bytes have been written from upstream. Stopping as this could result in data loss. Initiate a new upload to continue.';
906
-
907
-
this.emit('error',newRangeError(message));
908
-
return;
909
-
}
910
-
911
-
this.lastChunkSent=Buffer.alloc(0);
912
-
this.createURI(err=>{
913
-
if(err){
914
-
returnthis.destroy(err);
915
-
}
916
-
this.startUploading();
917
-
return;
918
-
});
919
-
}
920
-
921
920
/**
922
921
* @return {bool} is the request good?
923
922
*/
@@ -941,7 +940,7 @@ export class Upload extends Writable {
941
940
/**
942
941
* @param resp GaxiosResponse object from previous attempt
0 commit comments