Skip to content

Commit 29472ef

Browse files
authored
Merge pull request #712 from JonVisc/master
Allow exception data to pass through to the onErrorItem and onCompleteItem callbacks
2 parents c4619a5 + 1d8edd6 commit 29472ef

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/services/FileItem.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ export default function __identity($compile, FileLikeObject) {
6464
try {
6565
this.uploader.uploadItem(this);
6666
} catch(e) {
67-
this.uploader._onCompleteItem(this, '', 0, []);
68-
this.uploader._onErrorItem(this, '', 0, []);
67+
var message = e.name + ':' + e.message;
68+
this.uploader._onCompleteItem(this, message, e.code, []);
69+
this.uploader._onErrorItem(this, message, e.code, []);
6970
}
7071
}
7172
/**
@@ -250,4 +251,4 @@ export default function __identity($compile, FileLikeObject) {
250251
__identity.$inject = [
251252
'$compile',
252253
'FileLikeObject'
253-
];
254+
];

0 commit comments

Comments
 (0)