summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2017-10-10 15:57:20 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2017-10-10 18:05:15 +0200
commit84f8f634584e22a557bf50f077fb15967311908d (patch)
treec570982f05895d9f52de6dfe0f05d20e86bd8f07
parent7ca16405dd827f79b0c9f49f3b44774ce3553a85 (diff)
downloadlibnitrokey-84f8f634584e22a557bf50f077fb15967311908d.tar.gz
libnitrokey-84f8f634584e22a557bf50f077fb15967311908d.tar.bz2
Return exception type when DeviceCommunicationException is encountered
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
-rw-r--r--NK_C_API.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc
index bac11b3..822c95d 100644
--- a/NK_C_API.cc
+++ b/NK_C_API.cc
@@ -90,10 +90,10 @@ uint8_t get_without_result(T func){
NK_last_command_status = libraryException.exception_id();
}
catch (const InvalidCRCReceived &invalidCRCException){
- ;;;
+ ;
}
catch (const DeviceCommunicationException &deviceException){
- NK_last_command_status = -1;
+ NK_last_command_status = 256-deviceException.getType();
}
return NK_last_command_status;
}