1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
5 // Copyright (C) 2018-2019 Intel Corporation
8 #ifndef OPENCV_GAPI_UTIL_THROW_HPP
9 #define OPENCV_GAPI_UTIL_THROW_HPP
11 #include <utility> // std::forward
13 #if !defined(__EXCEPTIONS)
22 template <class ExceptionType>
23 [[noreturn]] void throw_error(ExceptionType &&e)
25 #if defined(__EXCEPTIONS) || defined(_CPPUNWIND)
26 throw std::forward<ExceptionType>(e);
28 fprintf(stderr, "An exception thrown! %s\n" , e.what());
36 #endif // OPENCV_GAPI_UTIL_THROW_HPP