Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • gjs gjs
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 99
    • Issues 99
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & 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
  • GNOME
  • gjsgjs
  • Issues
  • #454

Closed
Open
Created Jan 16, 2022 by Philip Chimento@ptomato🚮Maintainer

Print error cause when logging an error

The Error.cause feature is present in SpiderMonkey 91, meaning we can provide better error logs if the cause property is present on an error object.

This requires changing gjs_log_exception_full() to be recursive. In the case of a thrown value that is an Object with a cause property, the function should print something like Caused by:\n and then log that exception. Note that the cause may not be an object, or the cause may be a circular reference, and these cases must be handled and tested.

Also consider replacing the code in gjs_throw() that drops a second exception, to instead append the first exception to the second exception as the cause.

Assignee
Assign to
Time tracking