Browse Source

Adding Error Handling to output the errors to the stdio

Bradley Ouellette 4 years ago
parent
commit
9adfa51421
1 changed files with 9 additions and 1 deletions
  1. 9 1
      oboo-clock-cards/src/oboo-runtime/duktape/duk_config.h

+ 9 - 1
oboo-clock-cards/src/oboo-runtime/duktape/duk_config.h

@@ -2813,6 +2813,15 @@ typedef struct duk_hthread duk_context;
 #error __FAST_MATH__ defined, refusing to compile
 #endif
 
+#define DUK_USE_FATAL_HANDLER(udata,msg) do { \
+        const char *fatal_msg = (msg); /* avoid double evaluation */ \
+        (void) udata; \
+        fprintf(stderr, "*** FATAL ERROR: %s\n", fatal_msg ? fatal_msg : "no message"); \
+        fflush(stderr); \
+        abort(); \
+    } while (0)
+
+
 /*
  *  Autogenerated defaults
  */
@@ -2883,7 +2892,6 @@ typedef struct duk_hthread duk_context;
 #undef DUK_USE_EXTSTR_INTERN_CHECK
 #undef DUK_USE_FASTINT
 #define DUK_USE_FAST_REFCOUNT_DEFAULT
-#undef DUK_USE_FATAL_HANDLER
 #define DUK_USE_FATAL_MAXLEN 128
 #define DUK_USE_FINALIZER_SUPPORT
 #undef DUK_USE_FINALIZER_TORTURE