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
[Caml-list] exception messages pbs
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <xavier.leroy@i...>
Subject: Re: [Caml-list] exception messages pbs
> - long Failure exceptions get truncated, eg:

Right.  The string representation of the exception is computed in a
fixed-size buffer.  You can easily change the size of this buffer
(declaration of "struct stringbuf" in byterun/printexc.c).  Ideally,
the buffer would grow as needed...

> - when an exception occurs, the file descriptors are not flushed. To
> have them flushed, I use :
> try ... with e -> flush stdout ; raise e
> which works nicely, except that back-in-time debugging is harder (you have to
> go back the various catching code). Any better solution?

That's a known open issue.  The C code that traps and display the
exception could call back into Caml to perform the flushing (and more
generally all "at_exit" processing), but some care must be taken if
some of this processing raises an exception itself :-)

- Xavier Leroy
Bug reports:  FAQ:
To unsubscribe, mail  Archives: