Skip to content

Commit

Permalink
fix: 修复 util.getFileSizeByPath异常处理 (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
livehigh authored Mar 25, 2024
1 parent e260d89 commit 5960c9e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
9 changes: 5 additions & 4 deletions demo-album/lib/cos-wx-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -7450,7 +7450,7 @@ module.exports = function(module) {
/*! exports provided: name, version, description, main, scripts, repository, author, license, dependencies, devDependencies, default */
/***/ (function(module) {

module.exports = JSON.parse("{\"name\":\"cos-wx-sdk-v5\",\"version\":\"1.6.0\",\"description\":\"小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)\",\"main\":\"demo/lib/cos-wx-sdk-v5.min.js\",\"scripts\":{\"prettier\":\"prettier --write src demo/demo-sdk.js demo/test.js demo/ciDemo\",\"dev\":\"cross-env NODE_ENV=development node build.js --mode=development\",\"build\":\"cross-env NODE_ENV=production node build.js --mode=production\",\"sts.js\":\"node server/sts.js\"},\"repository\":{\"type\":\"git\",\"url\":\"http://github.com/tencentyun/cos-wx-sdk-v5.git\"},\"author\":\"carsonxu\",\"license\":\"ISC\",\"dependencies\":{\"@xmldom/xmldom\":\"^0.8.6\",\"mime\":\"^2.4.6\"},\"devDependencies\":{\"@babel/core\":\"7.17.9\",\"@babel/preset-env\":\"7.16.11\",\"babel-loader\":\"8.2.5\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^7.0.3\",\"express\":\"^4.17.1\",\"prettier\":\"^3.0.1\",\"qcloud-cos-sts\":\"^3.0.2\",\"terser-webpack-plugin\":\"4.2.3\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}");
module.exports = JSON.parse("{\"name\":\"cos-wx-sdk-v5\",\"version\":\"1.6.1\",\"description\":\"小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)\",\"main\":\"demo/lib/cos-wx-sdk-v5.min.js\",\"scripts\":{\"prettier\":\"prettier --write src demo/demo-sdk.js demo/test.js demo/ciDemo\",\"dev\":\"cross-env NODE_ENV=development node build.js --mode=development\",\"build\":\"cross-env NODE_ENV=production node build.js --mode=production\",\"sts.js\":\"node server/sts.js\"},\"repository\":{\"type\":\"git\",\"url\":\"http://github.com/tencentyun/cos-wx-sdk-v5.git\"},\"author\":\"carsonxu\",\"license\":\"ISC\",\"dependencies\":{\"@xmldom/xmldom\":\"^0.8.6\",\"mime\":\"^2.4.6\"},\"devDependencies\":{\"@babel/core\":\"7.17.9\",\"@babel/preset-env\":\"7.16.11\",\"babel-loader\":\"8.2.5\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^7.0.3\",\"express\":\"^4.17.1\",\"prettier\":\"^3.0.1\",\"qcloud-cos-sts\":\"^3.0.2\",\"terser-webpack-plugin\":\"4.2.3\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}");

/***/ }),

Expand Down Expand Up @@ -8341,15 +8341,16 @@ function _uploadFile() {
return util.getFileSizeByPath(params.FilePath);
case 6:
FileSize = _context.sent;
_context.next = 12;
_context.next = 13;
break;
case 9:
_context.prev = 9;
_context.t0 = _context["catch"](3);
callback({
error: _context.t0
});
case 12:
return _context.abrupt("return");
case 13:
fileInfo = {
TaskId: ''
}; // 上传链路
Expand Down Expand Up @@ -8399,7 +8400,7 @@ function _uploadFile() {
callback: onFileFinish
});
self._addTasks(taskList);
case 23:
case 24:
case "end":
return _context.stop();
}
Expand Down
2 changes: 1 addition & 1 deletion demo-album/lib/cos-wx-sdk-v5.min.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions demo/lib/cos-wx-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -7450,7 +7450,7 @@ module.exports = function(module) {
/*! exports provided: name, version, description, main, scripts, repository, author, license, dependencies, devDependencies, default */
/***/ (function(module) {

module.exports = JSON.parse("{\"name\":\"cos-wx-sdk-v5\",\"version\":\"1.6.0\",\"description\":\"小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)\",\"main\":\"demo/lib/cos-wx-sdk-v5.min.js\",\"scripts\":{\"prettier\":\"prettier --write src demo/demo-sdk.js demo/test.js demo/ciDemo\",\"dev\":\"cross-env NODE_ENV=development node build.js --mode=development\",\"build\":\"cross-env NODE_ENV=production node build.js --mode=production\",\"sts.js\":\"node server/sts.js\"},\"repository\":{\"type\":\"git\",\"url\":\"http://github.com/tencentyun/cos-wx-sdk-v5.git\"},\"author\":\"carsonxu\",\"license\":\"ISC\",\"dependencies\":{\"@xmldom/xmldom\":\"^0.8.6\",\"mime\":\"^2.4.6\"},\"devDependencies\":{\"@babel/core\":\"7.17.9\",\"@babel/preset-env\":\"7.16.11\",\"babel-loader\":\"8.2.5\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^7.0.3\",\"express\":\"^4.17.1\",\"prettier\":\"^3.0.1\",\"qcloud-cos-sts\":\"^3.0.2\",\"terser-webpack-plugin\":\"4.2.3\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}");
module.exports = JSON.parse("{\"name\":\"cos-wx-sdk-v5\",\"version\":\"1.6.1\",\"description\":\"小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)\",\"main\":\"demo/lib/cos-wx-sdk-v5.min.js\",\"scripts\":{\"prettier\":\"prettier --write src demo/demo-sdk.js demo/test.js demo/ciDemo\",\"dev\":\"cross-env NODE_ENV=development node build.js --mode=development\",\"build\":\"cross-env NODE_ENV=production node build.js --mode=production\",\"sts.js\":\"node server/sts.js\"},\"repository\":{\"type\":\"git\",\"url\":\"http://github.com/tencentyun/cos-wx-sdk-v5.git\"},\"author\":\"carsonxu\",\"license\":\"ISC\",\"dependencies\":{\"@xmldom/xmldom\":\"^0.8.6\",\"mime\":\"^2.4.6\"},\"devDependencies\":{\"@babel/core\":\"7.17.9\",\"@babel/preset-env\":\"7.16.11\",\"babel-loader\":\"8.2.5\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^7.0.3\",\"express\":\"^4.17.1\",\"prettier\":\"^3.0.1\",\"qcloud-cos-sts\":\"^3.0.2\",\"terser-webpack-plugin\":\"4.2.3\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}");

/***/ }),

Expand Down Expand Up @@ -8341,15 +8341,16 @@ function _uploadFile() {
return util.getFileSizeByPath(params.FilePath);
case 6:
FileSize = _context.sent;
_context.next = 12;
_context.next = 13;
break;
case 9:
_context.prev = 9;
_context.t0 = _context["catch"](3);
callback({
error: _context.t0
});
case 12:
return _context.abrupt("return");
case 13:
fileInfo = {
TaskId: ''
}; // 上传链路
Expand Down Expand Up @@ -8399,7 +8400,7 @@ function _uploadFile() {
callback: onFileFinish
});
self._addTasks(taskList);
case 23:
case 24:
case "end":
return _context.stop();
}
Expand Down
2 changes: 1 addition & 1 deletion demo/lib/cos-wx-sdk-v5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cos-wx-sdk-v5",
"version": "1.6.0",
"version": "1.6.1",
"description": "小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)",
"main": "demo/lib/cos-wx-sdk-v5.min.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions src/advance.js
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,7 @@ async function uploadFile(params, callback) {
FileSize = await util.getFileSizeByPath(params.FilePath);
} catch (e) {
callback({ error: e });
return;
}
var fileInfo = { TaskId: '' };

Expand Down

0 comments on commit 5960c9e

Please sign in to comment.