Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
exception error trace back in ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Sylvain Le Gall <sylvain@l...>
Subject: Re: exception error trace back in ocaml
On 21-06-2010, lin hong <> wrote:
> I have problem getting a full traceback of some exception error. The
> traceback looks like this:
> Fatal error: exception Invalid_argument("index out of bounds")
> Raised at file "", line 33, characters 10-11
> Called from file "", line 74, characters 24-34
> But that's all I got, both and are ocaml
> source code, I still don't know which part of my code trigger it. Also, in
> line 33, there is a "try .... with e -> raise e", is
> this the reason I don't have a full traceback -- Maybe something else
> catch the "raise e" ?  Any idea?

To get the full trace, you need to compile your code with "-g", i.e.
ocamlc -g 

If you don't have this debug flag, you won't see calls from the code you

The "try ... with e -> raise e" just re-raise the exception and you will
be able to see it in the full trace.

Sylvain Le Gall