diff options
author | George Claghorn <george@basecamp.com> | 2018-02-28 14:04:36 -0500 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-02-28 14:04:36 -0500 |
commit | 5a66a14226912ec873c039e6e681f837b0fde2e0 (patch) | |
tree | e994ae6b76f02638680f0237bea293ac94adaaae /activestorage/app | |
parent | 9dbc4754540a7374ad04b406bb0f6e97b7719479 (diff) | |
download | rails-5a66a14226912ec873c039e6e681f837b0fde2e0.tar.gz rails-5a66a14226912ec873c039e6e681f837b0fde2e0.tar.bz2 rails-5a66a14226912ec873c039e6e681f837b0fde2e0.zip |
Handle file checksumming errors
Diffstat (limited to 'activestorage/app')
-rw-r--r-- | activestorage/app/javascript/activestorage/direct_upload.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activestorage/app/javascript/activestorage/direct_upload.js b/activestorage/app/javascript/activestorage/direct_upload.js index 7085e0a4ab..c2eedf289b 100644 --- a/activestorage/app/javascript/activestorage/direct_upload.js +++ b/activestorage/app/javascript/activestorage/direct_upload.js @@ -14,8 +14,14 @@ export class DirectUpload { create(callback) { FileChecksum.create(this.file, (error, checksum) => { + if (error) { + callback(error) + return + } + const blob = new BlobRecord(this.file, checksum, this.url) notify(this.delegate, "directUploadWillCreateBlobWithXHR", blob.xhr) + blob.create(error => { if (error) { callback(error) |