From 9187e307c60fe0ef58d3a1cf68228675a13349bf Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 17 Aug 2013 08:23:21 -0400 Subject: [PATCH] mosh-client: Print exceptions after the client is shut down Otherwise the printed exception may be immediately hidden when the terminal exits alternate screen mode. Signed-off-by: Anders Kaseorg --- src/frontend/mosh-client.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/mosh-client.cc b/src/frontend/mosh-client.cc index e338682..58b94e4 100644 --- a/src/frontend/mosh-client.cc +++ b/src/frontend/mosh-client.cc @@ -176,11 +176,11 @@ int main( int argc, char *argv[] ) try { client.main(); } catch ( const Network::NetworkException &e ) { - fprintf( stderr, "Network exception: %s: %s\r\n", - e.function.c_str(), strerror( e.the_errno ) ); + client.shutdown(); + throw e; } catch ( const Crypto::CryptoException &e ) { - fprintf( stderr, "Crypto exception: %s\r\n", - e.text.c_str() ); + client.shutdown(); + throw e; } client.shutdown();