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 786183 - A few fixes for stack traces and error reporting
A few fixes for stack traces and error reporting
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
1.49.x
Other All
: Normal minor
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2017-08-11 23:59 UTC by Philip Chimento
Modified: 2017-08-13 23:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gerror: Use JS::CaptureCurrentStack for stack info (5.64 KB, patch)
2017-08-12 00:00 UTC, Philip Chimento
committed Details | Review
stack: Remove gjs_context_get_frame_info() (4.12 KB, patch)
2017-08-12 00:00 UTC, Philip Chimento
committed Details | Review
gerror: Define a columnNumber on GError-backed errors (2.70 KB, patch)
2017-08-12 00:00 UTC, Philip Chimento
committed Details | Review
console: Print exception even when not from SpiderMonkey (1.78 KB, patch)
2017-08-12 00:00 UTC, Philip Chimento
committed Details | Review

Description Philip Chimento 2017-08-11 23:59:48 UTC
Here are a few patches in the general area of stack traces and exception reporting.
Comment 1 Philip Chimento 2017-08-12 00:00:10 UTC
Created attachment 357451 [details] [review]
gerror: Use JS::CaptureCurrentStack for stack info

This uses the new facilities available in JSAPI to define the standard JS
Error properties on GError-marshalled exceptions, rather than the
workaround of creating a new Error object and reading its properties that
was previously used in gjs_context_get_frame_info().
Comment 2 Philip Chimento 2017-08-12 00:00:15 UTC
Created attachment 357452 [details] [review]
stack: Remove gjs_context_get_frame_info()

This is not needed anymore as we can now use the new facilities in JSAPI
for getting frame info, and use gjs_format_stack_trace() to build the
actual stack string.
Comment 3 Philip Chimento 2017-08-12 00:00:20 UTC
Created attachment 357453 [details] [review]
gerror: Define a columnNumber on GError-backed errors

Newer JS defines a columnNumber property on Error objects, so our
GError-backed ones should have this property as well.
Comment 4 Philip Chimento 2017-08-12 00:00:24 UTC
Created attachment 357454 [details] [review]
console: Print exception even when not from SpiderMonkey

This was a recent regression; the console shell would abort if an
exception couldn't be converted into an error report. However, only
exceptions created within SpiderMonkey have error reports associated with
them. Our exceptions created from GErrors do not, so if there is no error
report available simply convert the exception to a string.
Comment 5 Cosimo Cecchi 2017-08-12 00:42:42 UTC
Review of attachment 357451 [details] [review]:

OK
Comment 6 Cosimo Cecchi 2017-08-12 00:43:18 UTC
Review of attachment 357452 [details] [review]:

OK
Comment 7 Cosimo Cecchi 2017-08-12 00:43:40 UTC
Review of attachment 357453 [details] [review]:

++
Comment 8 Cosimo Cecchi 2017-08-12 00:44:28 UTC
Review of attachment 357454 [details] [review]:

OK
Comment 9 Philip Chimento 2017-08-13 23:39:29 UTC
Attachment 357451 [details] pushed as 12ff7d1 - gerror: Use JS::CaptureCurrentStack for stack info
Attachment 357452 [details] pushed as f2aa7cb - stack: Remove gjs_context_get_frame_info()
Attachment 357453 [details] pushed as 1ca6342 - gerror: Define a columnNumber on GError-backed errors
Attachment 357454 [details] pushed as 29ff8b8 - console: Print exception even when not from SpiderMonkey