Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 859
    • Issues 859
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 45
    • Merge requests 45
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Issues
  • #14
Closed
Open
Issue created Oct 07, 2003 by Bugzilla@bugzilla-migration💬Reporter

Reporting complex errors with GError

Submitted by David Malcolm

Link to original bug (#124022)

Description

I would like to be able to store "complicated" error reports in GError, making it more closely like exception handling in e.g. C++ and Java.

For example, if an XML document is not well-formed, I would like to be able to pass a struct containing complete file & line number information about all of the parser errors back to my GUI and provide a sensible user interface for this. I've got this working at the moment, but as soon as I reach a GError interface I have no way of preserving the rich information, and can only save a string.

So I would like to be able to store arbitrary user data in a GError.

Attached is a rough idea about what I had in mind. Unfortunately it breaks GLib ABI compatibility.

The idea is that you can store some kind of user data and have it copied, freed etc as the GError is copied and freed, and code can interpret it in a meaningful way if it recognises the domain and code.

Assignee
Assign to
Time tracking