@nger/fk-upload 1.0.94 → 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.
package/dist/main.js
CHANGED
@@ -148,7 +148,14 @@ let FkService = class FkService {
|
|
148
148
|
break;
|
149
149
|
}
|
150
150
|
if (uploadResult.code !== 200) {
|
151
|
-
|
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,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 {
|