mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-21 23:50:45 +00:00
After #2955, upload conflict checks lstat the destination first. New files throw ssh2's "No such file"; Electron invoke strips `code` and wraps the message, so isMissingStatError treated absence as a hard error and every new upload toasted.
14 lines
433 B
TypeScript
14 lines
433 B
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
import { isMissingStatError } from "./sftpStatError";
|
|
|
|
test("isMissingStatError recognizes ssh2 and Electron-wrapped absence", () => {
|
|
assert.equal(isMissingStatError(new Error("No such file")), true);
|
|
assert.equal(
|
|
isMissingStatError(
|
|
new Error("Error invoking remote method 'netcatty:sftp:lstat': Error: No such file"),
|
|
),
|
|
true,
|
|
);
|
|
});
|