[gjs: 5/6] gjs_context_eval: Log a critical on uncatchable exceptions



commit 6a49dc8edd15dbb74c00b5bf0df15e063b2319de
Author: Simon McVittie <smcv debian org>
Date:   Tue Jan 30 08:35:38 2018 +0000

    gjs_context_eval: Log a critical on uncatchable exceptions
    
    We probably don't actually want to abort or trap here, because there's
    a GError passed back to the caller, which is (hopefully) going to
    handle the exception gracefully; but an uncatchable exception indicates
    that something has gone badly wrong, so we should make some noise, and
    log a critical that can easily be made fatal by developers.
    
    Signed-off-by: Simon McVittie <smcv debian org>

 gjs/context.cpp | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gjs/context.cpp b/gjs/context.cpp
index bdeda42d..aa9b2a09 100644
--- a/gjs/context.cpp
+++ b/gjs/context.cpp
@@ -796,6 +796,8 @@ gjs_context_eval(GjsContext   *js_context,
         }
 
         if (!JS_IsExceptionPending(js_context->context)) {
+            g_critical("Script %s terminated with an uncatchable exception",
+                       filename);
             g_set_error(error, GJS_ERROR, GJS_ERROR_FAILED,
                         "Script %s terminated with an uncatchable exception",
                         filename);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]