1 // Copyright (C) 2018 Intel Corporation
3 // SPDX-License-Identifier: Apache-2.0
7 * \brief Wrappers from c++ function to c-style one
13 #include "description_buffer.hpp"
15 namespace InferenceEngine {
18 * @brief conversion of c++ exceptioned function call into c-style one
22 } catch (const InferenceEngine::details::InferenceEngineException & iex) { \
23 return InferenceEngine::DescriptionBuffer((iex.hasStatus() ? iex.getStatus() : GENERAL_ERROR), \
24 resp) << iex.what(); \
25 } catch (const std::exception & ex) {\
26 return InferenceEngine::DescriptionBuffer(GENERAL_ERROR, resp) << ex.what();\
28 return InferenceEngine::DescriptionBuffer(UNEXPECTED);\
31 #define TO_STATUS_NO_RESP(x)\
33 } catch (const InferenceEngine::details::InferenceEngineException & iex) { \
34 return InferenceEngine::DescriptionBuffer(iex.hasStatus() ? iex.getStatus() : GENERAL_ERROR)\
36 } catch (const std::exception & ex) {\
37 return InferenceEngine::DescriptionBuffer(GENERAL_ERROR) << ex.what();\
39 return InferenceEngine::DescriptionBuffer(UNEXPECTED);\
42 #define NO_EXCEPT_CALL_RETURN_VOID(x)\
44 } catch (const std::exception & ex) {\
48 #define NO_EXCEPT_CALL_RETURN_STATUS(x)\
50 } catch (const InferenceEngine::details::InferenceEngineException & iex) { \
51 return InferenceEngine::DescriptionBuffer(iex.hasStatus() ? iex.getStatus() : GENERAL_ERROR, \
52 resp) << iex.what(); \
53 } catch (const std::exception & ex) {\
54 return InferenceEngine::DescriptionBuffer(GENERAL_ERROR, resp) << ex.what();\
56 return InferenceEngine::DescriptionBuffer(UNEXPECTED);\
59 // TODO: replace by hierarchy of exceptions
60 #define PARAMETER_MISMATCH_str std::string("[PARAMETER_MISMATCH] ")
61 #define NETWORK_NOT_LOADED_str std::string("[NETWORK_NOT_LOADED] ")
62 #define NOT_FOUND_str std::string("[NOT_FOUND] ")
63 #define RESULT_NOT_READY_str std::string("[RESULT_NOT_READY] ")
64 #define INFER_NOT_STARTED_str std::string("[INFER_NOT_STARTED] ")
65 #define REQUEST_BUSY_str std::string("[REQUEST_BUSY] ")
66 #define NOT_IMPLEMENTED_str std::string("[NOT_IMPLEMENTED] ")
67 #define NOT_ALLOCATED_str std::string("[NOT_ALLOCATED] ")
69 } // namespace InferenceEngine