:set -fbreak-on-exception in GHCi causes exception in readFile

Sean Leather leather at cs.uu.nl
Fri Nov 20 13:02:36 EST 2009


On Fri, Nov 20, 2009 at 18:31, Jose Iborra wrote:

> This is by design, -fbreak-on-exception breaks on any exception, be it
> captured or not, even on library code.
>

Ah, that's what I missed. I would've guessed that it only breaks on uncaught
exceptions.


> I am not sure how readFile is implemented internally, but it probably reads
> from the file until an eoferror is thrown and then captures it gracefully.
>

That's what I expect, too. I went fishing, but didn't find the exact spot
where that happens within a few minutes.


> There is another debugger flag, -fbreak-on-error, which only breaks on
> unhandled exceptions.
> Is this what you want ?
>

Probably. Now I see the difference in [1]. Thanks!

[1]
http://www.haskell.org/ghc/docs/latest/html/users_guide/flag-reference.html#interactive-mode-options

Regards,
Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20091120/d9ecccfb/attachment.html


More information about the Glasgow-haskell-users mailing list