Opened 8 years ago

Closed 6 years ago

Last modified 6 years ago

#911 closed feature request (fixed)

Better information about the location of exceptions

Reported by: simonmar Owned by:
Priority: normal Milestone:
Component: Runtime System Version: 6.4.2
Keywords: Cc: frederik@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

From Frederik Eaton, on glasgow-haskell-bugs:

I think it would be a good idea to print instructions for getting more
information when a program fails with a pattern match or other error.

Rather than

foo: Prelude.undefined

it should say

foo: Prelude.undefined
For information about the location of this error, recompile with "-prof -auto-all" and run with "+RTS -xc -RTS"

Also, maybe these instructions aren't enough? When I do the above, it
just prints

<GHC.Err.CAF><GHC.Err.CAF><GHC.Err.CAF><GHC.Err.CAF>foo: Prelude.undefined

which isn't what I was looking for... Am I forgetting an option or
something?

Change History (5)

comment:1 Changed 8 years ago by ekarttun

The new ghci debugging stuff could help with locating the error.

The user's guide should probably have a note on locating failed pattern matches.

comment:2 Changed 7 years ago by igloo

  • Milestone set to _|_

comment:3 Changed 6 years ago by simonmar

  • Resolution set to fixed
  • Status changed from new to closed

The User's Guide has a section on "Debugging Exceptions".

I also improved the entry in the FAQ about "head []" to point to the relevant part of the docs.

comment:4 Changed 6 years ago by simonmar

  • Architecture changed from Unknown to Unknown/Multiple

comment:5 Changed 6 years ago by simonmar

  • Operating System changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.