Explorar o código

common: common_funcs: Log error on R_UNLESS.

bunnei %!s(int64=5) %!d(string=hai) anos
pai
achega
091e9e8c41
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      src/common/common_funcs.h

+ 3 - 0
src/common/common_funcs.h

@@ -97,6 +97,9 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
 #define R_UNLESS(expr, res)                                                                        \
     {                                                                                              \
         if (!(expr)) {                                                                             \
+            if (res.IsError()) {                                                                   \
+                LOG_CRITICAL(Kernel, "Failed with error {}", res.raw);                             \
+            }                                                                                      \
             return res;                                                                            \
         }                                                                                          \
     }