@@ -64,6 +64,9 @@ uint8_t * get_with_array_result(T func){
64
64
catch (LibraryException & libraryException){
65
65
NK_last_command_status = libraryException.exception_id ();
66
66
}
67
+ catch (const DeviceCommunicationException &deviceException){
68
+ NK_last_command_status = 256 -deviceException.getType ();
69
+ }
67
70
return nullptr ;
68
71
}
69
72
@@ -79,6 +82,9 @@ const char* get_with_string_result(T func){
79
82
catch (LibraryException & libraryException){
80
83
NK_last_command_status = libraryException.exception_id ();
81
84
}
85
+ catch (const DeviceCommunicationException &deviceException){
86
+ NK_last_command_status = 256 -deviceException.getType ();
87
+ }
82
88
return " " ;
83
89
}
84
90
@@ -94,6 +100,9 @@ auto get_with_result(T func){
94
100
catch (LibraryException & libraryException){
95
101
NK_last_command_status = libraryException.exception_id ();
96
102
}
103
+ catch (const DeviceCommunicationException &deviceException){
104
+ NK_last_command_status = 256 -deviceException.getType ();
105
+ }
97
106
return static_cast <decltype (func ())>(0 );
98
107
}
99
108
@@ -140,6 +149,11 @@ extern "C" {
140
149
NK_last_command_status = commandFailedException.last_command_status ;
141
150
return commandFailedException.last_command_status ;
142
151
}
152
+ catch (const DeviceCommunicationException &deviceException){
153
+ NK_last_command_status = 256 -deviceException.getType ();
154
+ cerr << deviceException.what () << endl;
155
+ return 0 ;
156
+ }
143
157
catch (std::runtime_error &e) {
144
158
cerr << e.what () << endl;
145
159
return 0 ;
0 commit comments