@nger/fk-upload 1.0.95 → 1.0.98

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,7 +148,14 @@ let FkService = class FkService {
148
148
  break;
149
149
  }
150
150
  if (uploadResult.code !== 200) {
151
- throw new Error(uploadResult.code);
151
+ if (uploadResult.data) {
152
+ const data = uploadResult.data;
153
+ if (data.limit) {
154
+ // to big
155
+ throw new Error(`to big`);
156
+ }
157
+ }
158
+ throw new Error(`${task.filename}--${uploadResult.msg}`);
152
159
  }
153
160
  if (uploadResult) {
154
161
  const data = uploadResult.data;
@@ -42,7 +42,13 @@ 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);
46
+ await complete();
47
+ }).catch(e => {
48
+ if (e.message === 'to big') {
49
+ return complete();
50
+ }
51
+ throw e;
46
52
  });
47
53
  }
48
54
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nger/fk-upload",
3
- "version": "1.0.95",
3
+ "version": "1.0.98",
4
4
  "description": "",
5
5
  "main": "dist/core.js",
6
6
  "types": "dist/core.d.ts",