[epiphany/mcatanzaro/passwords-for-gnome-3-32: 8/9] web-extension: Print better JS error messages
- From: Jan-Michael Brummer <jbrummer src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/passwords-for-gnome-3-32: 8/9] web-extension: Print better JS error messages
- Date: Mon, 4 Mar 2019 06:05:28 +0000 (UTC)
commit 0401e998a2cc0b727d2497985027e39bf8e02702
Author: Michael Catanzaro <mcatanzaro igalia com>
Date: Sun Mar 3 15:49:33 2019 -0600
web-extension: Print better JS error messages
The message alone is not enough detail to debug JS errors.
embed/web-extension/ephy-web-extension.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/embed/web-extension/ephy-web-extension.c b/embed/web-extension/ephy-web-extension.c
index 14dcc4469..a802ec83b 100644
--- a/embed/web-extension/ephy-web-extension.c
+++ b/embed/web-extension/ephy-web-extension.c
@@ -654,15 +654,14 @@ static void
js_exception_handler (JSCContext *context,
JSCException *exception)
{
- JSCValue *js_console;
- JSCValue *js_result;
+ g_autoptr(JSCValue) js_console = NULL;
+ g_autoptr(JSCValue) js_result = NULL;
+ g_autofree char *report = NULL;
js_console = jsc_context_get_value (context, "console");
js_result = jsc_value_object_invoke_method (js_console, "error", JSC_TYPE_EXCEPTION, exception,
G_TYPE_NONE);
- g_object_unref (js_result);
- g_object_unref (js_console);
-
- g_warning ("JavaScriptException: %s", jsc_exception_get_message (exception));
+ report = jsc_exception_report (exception);
+ g_warning ("%s", report);
jsc_context_throw_exception (context, exception);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]