From 2675570622b808aec77be240b4663e29598049ef Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Fri, 5 Aug 2016 19:49:34 +0200 Subject: Catch runtime exceptions on C API login and show them on screen Signed-off-by: Szczepan Zalega --- NK_C_API.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NK_C_API.cc b/NK_C_API.cc index d2aa38a..d93283d 100644 --- a/NK_C_API.cc +++ b/NK_C_API.cc @@ -79,6 +79,10 @@ extern int NK_login(const char *device_model) { NK_last_command_status = commandFailedException.last_command_status; return commandFailedException.last_command_status; } + catch (std::runtime_error &e){ + cerr << e.what() << endl; + return 0; + } return 0; } -- cgit v1.2.3