New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception printing bug? #3214
Comments
Comment author: administrator
Right, exceptions that take a tuple of arguments are special-cased
prints
so it's unclear we want to reproduce this bug in Printexc... Also, "exception E of int * string" would work fine in both printers.
How is the printing done? At the toplevel, via Printexc or by the exception E of string list;;exception E of string list let f () = raise (E ["hello"]);;val f : unit -> 'a = exception E of int;;exception E of int f ();;Exception: E _. It's due to the shadowing of the declaration of E. But even in this exception E of string;;exception E of string let f () = raise (E "hello");;val f : unit -> 'a = exception E of int;;exception E of int f ();;Exception: E "hello". Best wishes,
|
Comment author: administrator On Thu, 18 Nov 2004, Xavier Leroy wrote:
It's actually also Failure-exceptions which are sometimes printed Best regards, |
Comment author: administrator Waiting for repro case. |
Comment author: gerd I don't have a repro case for Failure, but for Invalid_argument. Separately reported as #4476. |
Comment author: @damiendoligez fixed in 3.10.2+dev2 |
Original bug ID: 3214
Reporter: administrator
Status: closed (set by @damiendoligez on 2008-01-22T11:03:20Z)
Resolution: fixed
Priority: normal
Severity: minor
Fixed in version: 3.10+dev
Category: ~DO NOT USE (was: OCaml general)
Related to: #4476
Bug description
Hi,
there seems to be a bug printing exceptions. First of all, the
implementations of the module Printexc and of byterun/printexc.c don't
match. E.g.:
exception E of (int * string)
let () =
let exc = E (42, "bla") in
print_endline (Printexc.to_string exc);
raise exc
As can be seen the C-function does a better job printing the escaping
exception.
In addition to this we have also complicated applications that sometimes
print out exceptions containing only one string argument without the
contents of the string, e.g.:
exception SomeException of string
Leads to the exception string:
SomeException (_)
instead of:
SomeException ("explanation of error")
I haven't yet managed to reproduce this error reliably. Maybe you have
an idea why this can happen?
Best regards,
Markus
--
Markus Mottl http://www.oefai.at/~markus markus@oefai.at
The text was updated successfully, but these errors were encountered: