Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions android/src/main/java/com/reactlibrary/RNSshClientModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,15 @@ public void run() {
client._dataOutputStream = new DataOutputStream(channel.getOutputStream());

callback.invoke();
} catch (JSchException error) {
Log.e(LOGTAG, "Error starting shell: " + error.getMessage());
callback.invoke(error.getMessage());
} catch (IOException error) {
Log.e(LOGTAG, "Error starting shell: " + error.getMessage());
callback.invoke(error.getMessage());
}

try {
// int charVal;
String line;
while (client._bufferedReader != null && (line = client._bufferedReader.readLine()) != null) {
Expand All @@ -193,11 +201,9 @@ public void run() {
}

} catch (JSchException error) {
Log.e(LOGTAG, "Error starting shell: " + error.getMessage());
callback.invoke(error.getMessage());
Log.e(LOGTAG, "Error reading shell output: " + error.getMessage());
} catch (IOException error) {
Log.e(LOGTAG, "Error starting shell: " + error.getMessage());
callback.invoke(error.getMessage());
Log.e(LOGTAG, "Error reading shell output: " + error.getMessage());
}
}
}).start();
Expand Down