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 715028 - GVariant: add way to print context of parse errors
GVariant: add way to print context of parse errors
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gvariant
unspecified
Other All
: Normal normal
: ---
Assigned To: Allison Karlitskaya (desrt)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-11-22 17:50 UTC by Allison Karlitskaya (desrt)
Modified: 2013-12-22 16:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GVariant: add way to print context of parse errors (8.27 KB, patch)
2013-11-22 17:50 UTC, Allison Karlitskaya (desrt)
committed Details | Review
gsettings tool: print GVariant errors in context (872 bytes, patch)
2013-11-22 17:55 UTC, Allison Karlitskaya (desrt)
committed Details | Review
gapplication(1): print GVariant errors in context (1.07 KB, patch)
2013-11-22 17:57 UTC, Allison Karlitskaya (desrt)
committed Details | Review
gdbus tool: print GVariant errors in context (2.81 KB, patch)
2013-11-22 18:07 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2013-11-22 17:50:46 UTC
See patch.
Comment 1 Allison Karlitskaya (desrt) 2013-11-22 17:50:48 UTC
Created attachment 261246 [details] [review]
GVariant: add way to print context of parse errors

This was a feature intended from the very beginning that somehow never
got written.  It's a way to replace these sort of error messages out of
the GVariant parser:

  1-2,10-15:unable to find a common type

with something in the style of the Vala compiler:

  unable to find a common type:
    [1, 2, 3, 'str']
     ^        ^^^^^
Comment 2 Allison Karlitskaya (desrt) 2013-11-22 17:55:55 UTC
Created attachment 261247 [details] [review]
gsettings tool: print GVariant errors in context

Use g_variant_parse_error_print_context() to format the error message
from the GVariant parser.
Comment 3 Allison Karlitskaya (desrt) 2013-11-22 17:57:57 UTC
Created attachment 261249 [details] [review]
gapplication(1): print GVariant errors in context

Use g_variant_parse_error_print_context() to format the error message
from the GVariant parser.
Comment 4 Allison Karlitskaya (desrt) 2013-11-22 18:07:45 UTC
Created attachment 261255 [details] [review]
gdbus tool: print GVariant errors in context

Use g_variant_parse_error_print_context() to format the error message
from the GVariant parser.

There is a slightly dubious interaction with the "parse me harder"
functionality here.  We're probably going to have to deal with that
separately.
Comment 5 Matthias Clasen 2013-11-29 03:35:49 UTC
Review of attachment 261247 [details] [review]:

looks good to me
Comment 6 Matthias Clasen 2013-11-29 03:58:50 UTC
Review of attachment 261246 [details] [review]:

ok
Comment 7 Matthias Clasen 2013-11-29 03:59:33 UTC
Review of attachment 261249 [details] [review]:

ok
Comment 8 Matthias Clasen 2013-11-29 04:03:10 UTC
Review of attachment 261255 [details] [review]:

ok
Comment 9 Allison Karlitskaya (desrt) 2013-12-22 16:42:27 UTC
Attachment 261246 [details] pushed as 56fb675 - GVariant: add way to print context of parse errors
Attachment 261247 [details] pushed as 420f90d - gsettings tool: print GVariant errors in context
Attachment 261249 [details] pushed as 94a89f6 - gapplication(1): print GVariant errors in context
Attachment 261255 [details] pushed as ee5dab6 - gdbus tool: print GVariant errors in context