[Haskell-cafe] Re: Haskell stacktrace

Michał Pałka michal.palka at poczta.fm
Wed Sep 10 09:47:09 EDT 2008


I was going to suggest using the -xc option of the GHC runtime (if you
are using GHC), but it seems that it doesn't always give meaningful
results as indicated here:
http://osdir.com/ml/lang.haskell.glasgow.bugs/2006-09/msg00008.html
and here:
http://www.haskell.org/pipermail/glasgow-haskell-users/2006-November/011549.html

You might want to try it anyway. It's documented in the GHC manual:
http://haskell.org/ghc/docs/latest/html/users_guide/runtime-control.html

Other than that, there are also haskell debuggers like hat, but I
haven't used them myself so I can't really tell if they could help here.

Best,
Michał

On Tue, 2008-09-09 at 22:35 +0200, Pieter Laeremans wrote:
> Woops , I hit the  "send" button to early.
> 
> 
> The java approach to locate the error would be
> 
> 
> try {   ... }catch(Exception e ){ 
> // log error 
> throw new RuntimeException(e);
> }
> 
> 
> ...
> 
> 
> What 's the best equivalent haskell approach ?
> 
> 
> thanks in advance,
> 
> 
> Pieter
> 
> 
> On Tue, Sep 9, 2008 at 10:30 PM, Pieter Laeremans
> <pieter at laeremans.org> wrote:
>         Hello,
>         
>         
>         I've written a cgi script in haskell, it crashes sometimes
>          with the error message Prelude . tail  : empty list
>         
>         
>         In Java we would use this approach to log the erro 
>         
>         
>         try {
>         
>         
>         } catch (Exception e) {
>         
>         
>         
>         
>         }
>         
>         
>         
>         -- 
>         Pieter Laeremans <pieter at laeremans.org>
>         
>         "The future is here. It's just not evenly distributed yet." W.
>         Gibson
>         
> 
> 
> 
> -- 
> Pieter Laeremans <pieter at laeremans.org>
> 
> "The future is here. It's just not evenly distributed yet." W. Gibson
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list