After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 649385 - make JS errors more visible to developers
make JS errors more visible to developers
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on: 649384 650298
Blocks:
 
 
Reported: 2011-05-04 15:56 UTC by Dan Winship
Modified: 2021-07-05 14:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shell-global: make JS errors more visible to developers (6.23 KB, patch)
2011-05-04 15:56 UTC, Dan Winship
none Details | Review
shell-global: make uncaught exceptions more visible to developers (3.71 KB, patch)
2011-05-04 15:56 UTC, Dan Winship
none Details | Review
messageTray: improve bad-markup handling (1.83 KB, patch)
2011-05-04 15:56 UTC, Dan Winship
none Details | Review
messageTray: add support for <tt> to message tray markup (1.82 KB, patch)
2011-05-04 15:56 UTC, Dan Winship
none Details | Review
shell-global: add markup support to shell_global_notify_error() (5.69 KB, patch)
2011-05-04 15:56 UTC, Dan Winship
none Details | Review
tests: fix up typelib include paths (2.80 KB, patch)
2011-05-18 18:54 UTC, Dan Winship
rejected Details | Review
tests: add a test for MessageTray._fixMarkup (6.17 KB, patch)
2011-05-18 18:54 UTC, Dan Winship
rejected Details | Review
shell-global: make JS warnings and exceptions more visible to developers (7.61 KB, patch)
2011-07-18 14:36 UTC, Dan Winship
reviewed Details | Review
messageTray: add support for <tt> to message tray markup (1.82 KB, patch)
2011-07-18 14:36 UTC, Dan Winship
none Details | Review
shell-global: add markup support to shell_global_notify_error() (5.79 KB, patch)
2011-07-18 14:36 UTC, Dan Winship
none Details | Review

Description Dan Winship 2011-05-04 15:56:03 UTC
see patches. the second one depends on bug 649384
Comment 1 Dan Winship 2011-05-04 15:56:06 UTC
Created attachment 187204 [details] [review]
shell-global: make JS errors more visible to developers

Override gjs's JS error reporter with our own. When running from the
source tree, use shell_global_notify_error() to report JS warnings, to
make it more noticeable when new code isn't quite working.

Also make shell_global_notify_error() log the error to stderr itself
(rather than having the JS handler do it), in case some error prevents
the JS handler from being able to run correctly.
Comment 2 Dan Winship 2011-05-04 15:56:08 UTC
Created attachment 187205 [details] [review]
shell-global: make uncaught exceptions more visible to developers

Add a gjs exception logger, and use that to present uncaught
exceptions via shell_global_notify_error, when running from the source
tree.
Comment 3 Dan Winship 2011-05-04 15:56:11 UTC
Created attachment 187206 [details] [review]
messageTray: improve bad-markup handling

_fixMarkup() was supposed to be ensuring that the markup we passed to
clutter was correct, but it was validating the syntax incorrectly, and
wasn't checking that the markup was valid (or even well-formed). This
is bad because if you pass bad pango markup to
clutter_text_set_markup(), it will g_warn and drop the string on the
floor.

Fix by fixing up the regexps, and then calling Pango.parse_markup() on
the result, and just xml-escaping everything if parse_markup() fails.
Comment 4 Dan Winship 2011-05-04 15:56:13 UTC
Created attachment 187207 [details] [review]
messageTray: add support for <tt> to message tray markup
Comment 5 Dan Winship 2011-05-04 15:56:16 UTC
Created attachment 187208 [details] [review]
shell-global: add markup support to shell_global_notify_error()

Add markup support to shell_global_notify_error(), and use it to
make JS warnings show up in monospace
Comment 6 Dan Winship 2011-05-18 18:54:45 UTC
Created attachment 188063 [details] [review]
tests: fix up typelib include paths

The js modules have so many imports back and forth that it's pretty
much guaranteed that if you import even one of them, you'll end up
importing all of them, including ui.status.bluetooth and
ui.status.network. So fix up the typelib include paths the same way
gnome-shell-jhbuild does, so we can find everything.
Comment 7 Dan Winship 2011-05-18 18:54:48 UTC
Created attachment 188064 [details] [review]
tests: add a test for MessageTray._fixMarkup
Comment 8 Dan Winship 2011-05-19 12:33:34 UTC
Comment on attachment 188063 [details] [review]
tests: fix up typelib include paths

attached to wrong bug
Comment 9 Dan Winship 2011-07-18 14:36:37 UTC
Created attachment 192191 [details] [review]
shell-global: make JS warnings and exceptions more visible to developers

Override gjs's JS error reporter with our own. When running from the
source tree, use shell_global_notify_error() to report JS warnings and
uncaught exceptions, to make it more noticeable when new code isn't
quite working.

Also make shell_global_notify_error() log the error to stderr itself
(rather than having the JS handler do it), in case some error prevents
the JS handler from being able to run correctly.
Comment 10 Dan Winship 2011-07-18 14:36:44 UTC
Created attachment 192192 [details] [review]
messageTray: add support for <tt> to message tray markup
Comment 11 Dan Winship 2011-07-18 14:36:50 UTC
Created attachment 192193 [details] [review]
shell-global: add markup support to shell_global_notify_error()

Add markup support to shell_global_notify_error(), and use it to
make JS warnings show up in monospace
Comment 12 Jasper St. Pierre (not reading bugmail) 2011-08-03 18:47:52 UTC
Review of attachment 192191 [details] [review]:

::: src/shell-global.c
@@ +504,3 @@
+
+  if (error)
+    g_string_append_printf (buf, "%u ", error);

Could we save the string from js.msg and use that instead of a useless numerical constant?

@@ +550,3 @@
+      in_notify_error)
+    {
+      g_printerr ("%s", buf->str);

I'm not sure I like this - can we print it to stderr in addition to having a source for the first ten messages in-tree? It's helpful for pasting the error to IRC and such.

@@ +560,3 @@
+    {
+      g_idle_add (idle_notify_error,
+                  g_strdup ("Further error reports will only be sent to stderr"));

Can you include this in the previous message instead of having it as a separate source?
Comment 13 GNOME Infrastructure Team 2021-07-05 14:43:07 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of  gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/

Thank you for your understanding and your help.