mirror of
https://github.com/apache/cordova-plugin-file-transfer.git
synced 2026-06-05 00:00:35 +08:00
CB-6781: Expose FileTransferError.exception to application
This commit is contained in:
+2
-2
@@ -125,7 +125,7 @@ FileTransfer.prototype.upload = function(filePath, server, successCallback, erro
|
||||
}
|
||||
|
||||
var fail = errorCallback && function(e) {
|
||||
var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body);
|
||||
var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body, e.exception);
|
||||
errorCallback(error);
|
||||
};
|
||||
|
||||
@@ -191,7 +191,7 @@ FileTransfer.prototype.download = function(source, target, successCallback, erro
|
||||
};
|
||||
|
||||
var fail = errorCallback && function(e) {
|
||||
var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body);
|
||||
var error = new FileTransferError(e.code, e.source, e.target, e.http_status, e.body, e.exception);
|
||||
errorCallback(error);
|
||||
};
|
||||
|
||||
|
||||
@@ -23,12 +23,13 @@
|
||||
* FileTransferError
|
||||
* @constructor
|
||||
*/
|
||||
var FileTransferError = function(code, source, target, status, body) {
|
||||
var FileTransferError = function(code, source, target, status, body, exception) {
|
||||
this.code = code || null;
|
||||
this.source = source || null;
|
||||
this.target = target || null;
|
||||
this.http_status = status || null;
|
||||
this.body = body || null;
|
||||
this.exception = exception || null;
|
||||
};
|
||||
|
||||
FileTransferError.FILE_NOT_FOUND_ERR = 1;
|
||||
|
||||
Reference in New Issue
Block a user