@nger/fk-upload 1.0.96 → 1.0.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -148,6 +148,13 @@ let FkService = class FkService {
148
148
  break;
149
149
  }
150
150
  if (uploadResult.code !== 200) {
151
+ if (uploadResult.data) {
152
+ const data = uploadResult.data;
153
+ if (data.limit) {
154
+ // to big
155
+ throw new Error(`to big`);
156
+ }
157
+ }
151
158
  throw new Error(`${task.filename}--${uploadResult.msg}`);
152
159
  }
153
160
  if (uploadResult) {
@@ -42,7 +42,12 @@ class UploadTask extends rabbitmq_1.Task {
42
42
  console.log(`upload success`, res.filename);
43
43
  await db.manager.update(entities_1.FkDownloadTaskEntity, task.filename, { status: 2, uploadUrl: task.uploadUrl, uploadSize: task.total, uploadStatus: 1 });
44
44
  const effectTask = await taskService.createEffectTask(res.filename, res.uploadUrl, task.topicId, task.path);
45
- await manager.send(effectTask).then(() => complete());
45
+ await manager.send(effectTask).then(() => complete()).catch(e => {
46
+ if (e.message === 'to big') {
47
+ return complete();
48
+ }
49
+ throw e;
50
+ });
46
51
  });
47
52
  }
48
53
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nger/fk-upload",
3
- "version": "1.0.96",
3
+ "version": "1.0.97",
4
4
  "description": "",
5
5
  "main": "dist/core.js",
6
6
  "types": "dist/core.d.ts",