1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
6 * \brief Wrappers from c++ function to c-style one
12 #include "description_buffer.hpp"
14 namespace InferenceEngine {
17 * @brief conversion of c++ exceptioned function call into c-style one
21 } catch (const InferenceEngine::details::InferenceEngineException & iex) { \
22 return InferenceEngine::DescriptionBuffer((iex.hasStatus() ? iex.getStatus() : GENERAL_ERROR), \
23 resp) << iex.what(); \
24 } catch (const std::exception & ex) {\
25 return InferenceEngine::DescriptionBuffer(GENERAL_ERROR, resp) << ex.what();\
27 return InferenceEngine::DescriptionBuffer(UNEXPECTED);\
30 #define TO_STATUS_NO_RESP(x)\
32 } catch (const InferenceEngine::details::InferenceEngineException & iex) { \
33 return InferenceEngine::DescriptionBuffer(iex.hasStatus() ? iex.getStatus() : GENERAL_ERROR)\
35 } catch (const std::exception & ex) {\
36 return InferenceEngine::DescriptionBuffer(GENERAL_ERROR) << ex.what();\
38 return InferenceEngine::DescriptionBuffer(UNEXPECTED);\
41 #define NO_EXCEPT_CALL_RETURN_VOID(x)\
43 } catch (const std::exception & ex) {\
47 #define NO_EXCEPT_CALL_RETURN_STATUS(x)\
49 } catch (const InferenceEngine::details::InferenceEngineException & iex) { \
50 return InferenceEngine::DescriptionBuffer(iex.hasStatus() ? iex.getStatus() : GENERAL_ERROR, \
51 resp) << iex.what(); \
52 } catch (const std::exception & ex) {\
53 return InferenceEngine::DescriptionBuffer(GENERAL_ERROR, resp) << ex.what();\
55 return InferenceEngine::DescriptionBuffer(UNEXPECTED);\
58 // TODO: replace by hierarchy of exceptions
59 #define PARAMETER_MISMATCH_str std::string("[PARAMETER_MISMATCH] ")
60 #define NETWORK_NOT_LOADED_str std::string("[NETWORK_NOT_LOADED] ")
61 #define NOT_FOUND_str std::string("[NOT_FOUND] ")
62 #define RESULT_NOT_READY_str std::string("[RESULT_NOT_READY] ")
63 #define INFER_NOT_STARTED_str std::string("[INFER_NOT_STARTED] ")
64 #define REQUEST_BUSY_str std::string("[REQUEST_BUSY] ")
65 #define NOT_IMPLEMENTED_str std::string("[NOT_IMPLEMENTED] ")
66 #define NOT_ALLOCATED_str std::string("[NOT_ALLOCATED] ")
68 } // namespace InferenceEngine