From: Olivier Andrieu <andrieu@ijm.jussieu.fr>
To: m.lahr@re-entry.de
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Matching Unix_error
Date: Thu, 03 Feb 2005 13:40:42 +0100 (CET) [thread overview]
Message-ID: <20050203.134042.63128009.andrieu@ijm.jussieu.fr> (raw)
In-Reply-To: <20050203111702.GA31877@re-entry.de>
Michael Lahr [Thu, 3 Feb 2005]:
> Hi,
>
> i'm trying something like this:
>
> let start () =
> try pipe#run() with
> Unix.Unix_error(_,_,_) -> print_string "matched\n"
> | _ -> print_string "not matched\n"; raise e ;
>
> start();;
>
> where pipe is a http_client's pipeline.
>
> The output is:
>
> not matched
> Fatal error: exception Unix.Unix_error(38, "connect", "")
>
> what's wrong here? shouldn't the expression Unix.Unix_error(_,_,_) match
> this error?
> btw this error occurs only when running under oUnit.
> Any clues?
I had this problem once, it was due to a library that was incorrectly
packaged. The library was built like this :
ocamlc -a -o foo.cma unix.cma foo.cmo ...
i.e. the library itself included unix.cma. When I built my program
like this :
ocamlc -o my_prog unix.cma foo.cma my_prog.ml
it had this behavior (the exceptions escaping the try .. with).
--
Olivier
next prev parent reply other threads:[~2005-02-03 12:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-03 11:17 Michael Lahr
2005-02-03 12:40 ` Olivier Andrieu [this message]
2005-02-03 12:55 ` [Caml-list] " Michael Lahr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050203.134042.63128009.andrieu@ijm.jussieu.fr \
--to=andrieu@ijm.jussieu.fr \
--cc=caml-list@inria.fr \
--cc=m.lahr@re-entry.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox