@@ -26,7 +26,6 @@ struct ovep_exception : public std::exception {
2626 type_{type},
2727 error_code_{ze_result_code_from_string (message)},
2828 error_name_{ze_result_name_from_string (message)} {}
29- // ovep_exception(const std::exception& ex) : message_{ex.what()} {}
3029
3130 const char * what () const noexcept override {
3231 return message_.data ();
@@ -59,24 +58,22 @@ struct ovep_exception : public std::exception {
5958 std::string error_name_;
6059
6160 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) {
6362 uint32_t error_code{0 };
6463 std::regex error_code_pattern (" code 0x([0-9a-fA-F]+)" );
6564 std::smatch matches;
6665 if (std::regex_search (ov_exception_string, matches, error_code_pattern)) {
6766 std::from_chars (&(*matches[1 ].first ), &(*matches[1 ].second ), error_code, 16 );
6867 }
69- // std::string message{error_message + ", code 0x" + std::to_string(error_code) + "\nModel needs to be recompiled\n"};
7068 return error_code;
7169 }
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) {
7371 std::string error_message = " UNKNOWN NPU ERROR" ;
7472 std::regex error_message_pattern (R"( \bZE_\w*\b)" );
7573 std::smatch matches;
7674 if (std::regex_search (ov_exception_string, matches, error_message_pattern)) {
7775 error_message = matches[0 ];
7876 }
79- // std::string message{error_message + ", code 0x" + std::to_string(error_code) + "\nModel needs to be recompiled\n"};
8077 return error_message;
8178 }
8279};
0 commit comments