1 #ifndef LIBDNF_CATCH_ERROR_HPP
2 #define LIBDNF_CATCH_ERROR_HPP
3 
4 #include "error.hpp"
5 #include "goal/Goal.hpp"
6 
7 #include <glib.h>
8 
9 
10 #define CATCH_TO_GERROR(RET)                                                   \
11 catch (const libdnf::Goal::Error& e) {                                         \
12     g_set_error_literal(error, DNF_ERROR, e.getErrCode(), e.what());           \
13     return RET;                                                                \
14 } catch (const libdnf::Error& e) {                                             \
15     g_set_error_literal(error, DNF_ERROR, DNF_ERROR_INTERNAL_ERROR, e.what()); \
16     return RET;                                                                \
17 }
18 
19 #endif
20