Menu ▾ ▴

#2 Handling non-IO exceptions

open
nobody
None
5
2002-10-21
2002-10-21
Anonymous
No

performTestCase does not properly handle non-IO errors:

decode e = let s0 = ioeGetErrorString e
-> (_, s1) = dropPrefix hugsPrefix s0
-> (_, s2) = dropPrefix nhc98Prefix s1
-> in dropPrefix hunitPrefix s2

ioeGetErrorString errors with non-IO exceptions.

possible fix:

> decode exc@(IOException e) = let s0 =
ioeGetErrorString exc
>
(_, s1) = dropPrefix hugsPrefix s0
>
(_, s2) = dropPrefix nhc98Prefix s1
>
in dropPrefix hunitPrefix s2
> decode exc = (False, show exc)

Discussion


Log in to post a comment.