diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2016-08-05 19:49:34 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2016-08-05 20:32:45 +0200 |
commit | 2675570622b808aec77be240b4663e29598049ef (patch) | |
tree | 1859af97ae7b0f5cf69142dd8775b17bef60c79e | |
parent | a579c6906f9f7fe6e19c70a44f74c0d2148c8085 (diff) | |
download | libnitrokey-2675570622b808aec77be240b4663e29598049ef.tar.gz libnitrokey-2675570622b808aec77be240b4663e29598049ef.tar.bz2 |
Catch runtime exceptions on C API login and show them on screen
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r-- | NK_C_API.cc | 4 |
1 files changed, 4 insertions, 0 deletions
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; } |