提交 283c00b0 编写于 作者: M mahaifeng

[file-manager]修改错误类型

上级 88ada333
...@@ -164,12 +164,12 @@ ...@@ -164,12 +164,12 @@
this.statsRet = res.stats this.statsRet = res.stats
console.log('this.statsRet', this.statsRet) console.log('this.statsRet', this.statsRet)
}, },
fail: (res : UniError) => { fail: (res:IUniError ) => {
if (this.logAble) { if (this.logAble) {
this.log += 'statFileInfoTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'statFileInfoTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('statFileInfoTest fail', res) console.log('statFileInfoTest fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
console.log("statFileInfoTest complete", res) console.log("statFileInfoTest complete", res)
...@@ -195,12 +195,12 @@ ...@@ -195,12 +195,12 @@
this.getFileInfoSize = res.size this.getFileInfoSize = res.size
this.getFileInfoDigest = res.digest this.getFileInfoDigest = res.digest
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'getFileInfoTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'getFileInfoTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
console.log("complete", res) console.log("complete", res)
...@@ -224,12 +224,12 @@ ...@@ -224,12 +224,12 @@
} }
console.log('success', res) console.log('success', res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'copyFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'copyFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
console.log("complete", res) console.log("complete", res)
...@@ -253,12 +253,12 @@ ...@@ -253,12 +253,12 @@
} }
console.log('success', res) console.log('success', res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'renameFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'renameFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
this.done = true this.done = true
...@@ -281,12 +281,12 @@ ...@@ -281,12 +281,12 @@
console.log("success", res) console.log("success", res)
this.fileListSuccess = res.files this.fileListSuccess = res.files
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'readDirTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'readDirTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
console.log("complete", res) console.log("complete", res)
...@@ -313,12 +313,12 @@ ...@@ -313,12 +313,12 @@
} }
console.log('success', res) console.log('success', res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'writeFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'writeFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail') console.log('fail')
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
this.done = true this.done = true
...@@ -344,12 +344,12 @@ ...@@ -344,12 +344,12 @@
console.log('success', res) console.log('success', res)
this.readFileRet = res.data this.readFileRet = res.data
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'readFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'readFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
console.log("complete", res) console.log("complete", res)
...@@ -372,12 +372,12 @@ ...@@ -372,12 +372,12 @@
} }
console.log('success', res) console.log('success', res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'rmdirTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'rmdirTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
console.log("complete", res) console.log("complete", res)
...@@ -402,12 +402,13 @@ ...@@ -402,12 +402,13 @@
} }
console.log('success', res) console.log('success', res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'mkdirTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'mkdirTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
if (res instanceof UniError) { if (res instanceof UniError) {
...@@ -431,12 +432,13 @@ ...@@ -431,12 +432,13 @@
console.log('success', res) console.log('success', res)
this.accessFileRet = res.errMsg this.accessFileRet = res.errMsg
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'accessFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'accessFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
if (res instanceof UniError) { if (res instanceof UniError) {
...@@ -459,12 +461,13 @@ ...@@ -459,12 +461,13 @@
} }
console.log('success', res) console.log('success', res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'unlinkTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'unlinkTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
if (res instanceof UniError) { if (res instanceof UniError) {
...@@ -497,12 +500,13 @@ ...@@ -497,12 +500,13 @@
} }
console.log('success unlink', res) console.log('success unlink', res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'unlinkAllFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'unlinkAllFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail unlink', res) console.log('fail unlink', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
if (res instanceof UniError) { if (res instanceof UniError) {
...@@ -514,12 +518,13 @@ ...@@ -514,12 +518,13 @@
} as UnLinkOptions) } as UnLinkOptions)
}); });
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'unlinkAllFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'unlinkAllFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail to readdir', res) console.log('fail to readdir', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
console.log("complete readdir", res) console.log("complete readdir", res)
...@@ -544,12 +549,13 @@ ...@@ -544,12 +549,13 @@
} }
console.log('success', res) console.log('success', res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'copyFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'copyFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
console.log("complete", res) console.log("complete", res)
...@@ -573,12 +579,13 @@ ...@@ -573,12 +579,13 @@
} }
console.log('success', res) console.log('success', res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'appendFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'appendFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail') console.log('fail')
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
this.done = true this.done = true
...@@ -757,12 +764,13 @@ ...@@ -757,12 +764,13 @@
this.saveFileRet = res.savedFilePath this.saveFileRet = res.savedFilePath
this.done = true this.done = true
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'saveFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'saveFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('saveFileTest fail', res) console.log('saveFileTest fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
this.done = true this.done = true
}, },
complete: (_) => { complete: (_) => {
...@@ -801,12 +809,13 @@ ...@@ -801,12 +809,13 @@
} }
console.log('success', res) console.log('success', res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'unzipFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'unzipFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (_) => { complete: (_) => {
this.done = true this.done = true
...@@ -825,12 +834,13 @@ ...@@ -825,12 +834,13 @@
this.fileListSuccess = res.fileList this.fileListSuccess = res.fileList
this.getSavedFileListRet = "getSavedFileList:ok" this.getSavedFileListRet = "getSavedFileList:ok"
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'getSavedFileListTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'getSavedFileListTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('getSavedFileListTest fail', res) console.log('getSavedFileListTest fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
this.getSavedFileListRet = JSON.stringify(res) this.getSavedFileListRet = JSON.stringify(res)
}, },
complete: (res : any) => { complete: (res : any) => {
...@@ -855,12 +865,13 @@ ...@@ -855,12 +865,13 @@
} }
console.log("success", res) console.log("success", res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'truncateFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'truncateFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
console.log("complete", res) console.log("complete", res)
...@@ -894,12 +905,13 @@ ...@@ -894,12 +905,13 @@
} }
console.log("success", res) console.log("success", res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'readCompressedFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'readCompressedFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (_) => { complete: (_) => {
this.done = true this.done = true
...@@ -937,7 +949,7 @@ ...@@ -937,7 +949,7 @@
this.removeSavedFileRet = res.errMsg this.removeSavedFileRet = res.errMsg
console.log("removeSavedFileTest success", res) console.log("removeSavedFileTest success", res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'removeSavedFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'removeSavedFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
...@@ -981,12 +993,13 @@ ...@@ -981,12 +993,13 @@
console.log("success", res) console.log("success", res)
this.fd = res.fd this.fd = res.fd
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'openFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'openFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (_) => { complete: (_) => {
this.done = true this.done = true
...@@ -1047,12 +1060,13 @@ ...@@ -1047,12 +1060,13 @@
this.closeFileRet = res.errMsg this.closeFileRet = res.errMsg
console.log("success", res) console.log("success", res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'closeTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'closeTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (_) => { complete: (_) => {
this.done = true this.done = true
...@@ -1079,12 +1093,13 @@ ...@@ -1079,12 +1093,13 @@
console.log("success", res) console.log("success", res)
this.bytesWritten = res.bytesWritten this.bytesWritten = res.bytesWritten
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'writeTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'writeTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (_) => { complete: (_) => {
this.done = true this.done = true
...@@ -1128,12 +1143,13 @@ ...@@ -1128,12 +1143,13 @@
this.done = true this.done = true
} }
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'openFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'openFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
this.done = true this.done = true
} }
} as OpenFileOptions) } as OpenFileOptions)
...@@ -1150,12 +1166,13 @@ ...@@ -1150,12 +1166,13 @@
console.log("success", res) console.log("success", res)
this.fstat = res.stats this.fstat = res.stats
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'fstatTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'fstatTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (_) => { complete: (_) => {
this.done = true this.done = true
...@@ -1193,12 +1210,13 @@ ...@@ -1193,12 +1210,13 @@
} }
this.ftruncateRet = res.errMsg this.ftruncateRet = res.errMsg
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'ftruncateFileTest fail:' + JSON.stringify(res) + '\n\n' this.log += 'ftruncateFileTest fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
}, },
complete: (res : any) => { complete: (res : any) => {
console.log("complete", res) console.log("complete", res)
...@@ -1239,12 +1257,13 @@ ...@@ -1239,12 +1257,13 @@
} }
console.log("success", res) console.log("success", res)
}, },
fail: (res : UniError) => { fail: (res : IUniError) => {
if (this.logAble) { if (this.logAble) {
this.log += 'readZipEntry fail:' + JSON.stringify(res) + '\n\n' this.log += 'readZipEntry fail:' + JSON.stringify(res) + '\n\n'
} }
console.log('fail', res) console.log('fail', res)
this.lastFailError = res this.lastFailError=new UniError(res.errSubject, res.errCode, res.errMsg)
} }
} as ReadZipEntryOptions) } as ReadZipEntryOptions)
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册