Skip to content

Commit e1d829e

Browse files
committed
handle errors and failures
1 parent 06eff06 commit e1d829e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/lib/openFolder.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ async function expandList($list) {
204204
});
205205
} catch (err) {
206206
$list.collapse();
207+
if (err?.includes("Invalid message length")) {
208+
console.error(err);
209+
toast("SFTP connection broken. Restart the app");
210+
return;
211+
}
207212
helpers.error(err);
208213
} finally {
209214
stopLoading();

src/plugins/sftp/src/com/foxdebug/sftp/Sftp.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,12 @@ public void isConnected(JSONArray args, CallbackContext callback) {
658658
.execute(
659659
new Runnable() {
660660
public void run() {
661-
if (ssh != null && ssh.isConnected()) {
661+
if (
662+
ssh != null &&
663+
ssh.isConnected() &&
664+
sftp != null &&
665+
!sftp.isClosed()
666+
) {
662667
callback.success(connectionID);
663668
return;
664669
}

0 commit comments

Comments
 (0)