Skip to content

Commit

Permalink
fix: missing errors logging (#244)
Browse files Browse the repository at this point in the history
closes #243 #242
  • Loading branch information
kukhariev committed Jul 13, 2020
1 parent 8d875c1 commit a902dfc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/uploadx/lib/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ export abstract class Uploader implements UploadState {
this.startTime = new Date().getTime();
this.url = this.url || (await this.getFileUrl());
this.errorHandler.reset();
await this.start();
} catch {
// TODO: e log
this.start().then(_ => {});
} catch (e) {
e instanceof Error && console.error(e);
if (this.errorHandler.kind(this.responseStatus) !== ErrorType.FatalError) {
this.status = 'retry';
await this.errorHandler.wait();
Expand All @@ -158,8 +158,8 @@ export abstract class Uploader implements UploadState {
}
this.errorHandler.reset();
this.offset = offset;
} catch {
// TODO: e log
} catch (e) {
e instanceof Error && console.error(e);
const errType = this.errorHandler.kind(this.responseStatus);
if (this.responseStatus === 413) {
DynamicChunk.maxSize = this.chunkSize /= 2;
Expand Down

0 comments on commit a902dfc

Please sign in to comment.