@lacrous/omnicloud 0.2.24 → 0.2.25
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/index.cjs +9 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -10
- package/dist/index.d.ts +3 -10
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/server/index.js +10 -2
package/dist/index.cjs
CHANGED
|
@@ -1500,6 +1500,13 @@ function uploadRequestFingerprint(input) {
|
|
|
1500
1500
|
}
|
|
1501
1501
|
|
|
1502
1502
|
// ../core/src/services/file-service.ts
|
|
1503
|
+
function connectionCausedFailure(error) {
|
|
1504
|
+
if (error instanceof TelegramConnectionError) return true;
|
|
1505
|
+
if (error instanceof UploadFailedError) {
|
|
1506
|
+
return error.details instanceof TelegramConnectionError;
|
|
1507
|
+
}
|
|
1508
|
+
return false;
|
|
1509
|
+
}
|
|
1503
1510
|
var FileService = class {
|
|
1504
1511
|
constructor(files, folders, engineFor, activity = noopActivityRecorder, operations = null, log = null) {
|
|
1505
1512
|
this.files = files;
|
|
@@ -1576,8 +1583,9 @@ var FileService = class {
|
|
|
1576
1583
|
await operations.update(op.id, { status: "COMPLETED", fileId: record.id });
|
|
1577
1584
|
return record;
|
|
1578
1585
|
} catch (error) {
|
|
1586
|
+
const status = connectionCausedFailure(error) ? "UNKNOWN" : "FAILED";
|
|
1579
1587
|
await operations.update(op.id, {
|
|
1580
|
-
status
|
|
1588
|
+
status,
|
|
1581
1589
|
error: error instanceof Error ? error.message.slice(0, 200) : "upload failed"
|
|
1582
1590
|
});
|
|
1583
1591
|
throw error;
|