Skip to content

Commit 787ad3e

Browse files
authored
Merge pull request #1207 from atsign-foundation/gkc/fix-1182
fix: When running npt in keep-alive mode then the keep-alive loop should never exit due to an exception from `npt.run()`
2 parents f22570a + 6a234db commit 787ad3e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/dart/sshnoports/bin/npt.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,18 @@ void main(List<String> args) async {
340340
if (!keepAlive) {
341341
throw SshnpError(e.toString());
342342
}
343+
} on SshnpError catch (e) {
344+
logProgress(e.toString());
345+
await npt.close();
346+
if (!keepAlive) {
347+
rethrow;
348+
}
349+
} catch (e) {
350+
logProgress(e.toString());
351+
await npt.close();
352+
if (!keepAlive) {
353+
rethrow;
354+
}
343355
}
344356

345357
await npt.done;

0 commit comments

Comments
 (0)