Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in
H
haskell-gargantext-prelude
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 1
    • Issues 1
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • gargantext
  • haskell-gargantext-prelude
  • Merge Requests
  • !11

Merged
Opened Dec 04, 2023 by Alfredo Di Napoli@AlfredoDiNapoli
  • Report abuse
Report abuse

Introduce `panicTrace` and `errorTrace`

This MR does two things:

  1. It introduces (and exports) the panicTrace and errorTrace functions in our Prelude, to be used as a drop-in replacement for panic and error. The glaring advantage is that they allow attaching a stacktrace of where the exception originated.

Compare, using panic in gargPassUserEasy':

Screenshot_2023-12-04_at_09.51.19

Conversely, if we use panicTrace instead:

Screenshot_2023-12-04_at_09.51.36

Now we know exactly where the error originated.

  1. I have re-exported the original panic and error but I have marked them with the DEPRECATED pragma, so that if we compile gargantext and we still have instances of panic and error in the codebase, GHC will warn us (and stop compilation if -Werror is used):

Screenshot_2023-12-04_at_09.56.35

cc @anoe and @cgenie

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b adinapoli/panic-and-error-trace origin/adinapoli/panic-and-error-trace

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/master
git merge --no-ff adinapoli/panic-and-error-trace

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 1
  • Commits 3
  • Changes 6
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: gargantext/haskell-gargantext-prelude!11

Revert this commit

This will create a new commit in order to revert the existing changes.

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.

Cherry-pick this commit

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.