@@ -26,7 +26,6 @@ struct ovep_exception : public std::exception {
26
26
type_{type},
27
27
error_code_{ze_result_code_from_string (message)},
28
28
error_name_{ze_result_name_from_string (message)} {}
29
- // ovep_exception(const std::exception& ex) : message_{ex.what()} {}
30
29
31
30
const char * what () const noexcept override {
32
31
return message_.data ();
@@ -59,24 +58,22 @@ struct ovep_exception : public std::exception {
59
58
std::string error_name_;
60
59
61
60
private:
62
- uint32_t ze_result_code_from_string (const std::string & ov_exception_string) {
61
+ uint32_t ze_result_code_from_string (const std::string& ov_exception_string) {
63
62
uint32_t error_code{0 };
64
63
std::regex error_code_pattern (" code 0x([0-9a-fA-F]+)" );
65
64
std::smatch matches;
66
65
if (std::regex_search (ov_exception_string, matches, error_code_pattern)) {
67
66
std::from_chars (&(*matches[1 ].first ), &(*matches[1 ].second ), error_code, 16 );
68
67
}
69
- // std::string message{error_message + ", code 0x" + std::to_string(error_code) + "\nModel needs to be recompiled\n"};
70
68
return error_code;
71
69
}
72
- std::string ze_result_name_from_string (const std::string & ov_exception_string) {
70
+ std::string ze_result_name_from_string (const std::string& ov_exception_string) {
73
71
std::string error_message = " UNKNOWN NPU ERROR" ;
74
72
std::regex error_message_pattern (R"( \bZE_\w*\b)" );
75
73
std::smatch matches;
76
74
if (std::regex_search (ov_exception_string, matches, error_message_pattern)) {
77
75
error_message = matches[0 ];
78
76
}
79
- // std::string message{error_message + ", code 0x" + std::to_string(error_code) + "\nModel needs to be recompiled\n"};
80
77
return error_message;
81
78
}
82
79
};
0 commit comments