[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Throwing an Unix.unix_error from C code



Florian Weimer <fw@deneb.enyo.de> writes:

> * Goswin von Brederlow:
>
>> Florian Weimer <fw@deneb.enyo.de> writes:
>>
>>> * Goswin von Brederlow:
>>>
>>>> - I create a 3 tupple exp
>>>> - fill it with (Val_int(errno), caml_copy_string("MD5.file"), filename)
>>>> - call caml_raise_with_arg(tag, exp)
>>>
>>> This raises an exception with a parenthesized tuple ("exception E of
>>> (int * string * string)", IOW a single-argument exception which takes
>>> a triple as argument.
>>
>> Which I believe is correct.
>
> No, Unix_Error is declared thusly:
>
> exception Unix_error of error * string * string
>
> No parantheses, no additional level of indirection.

So what structure do I need to throw?

Or can caml_raise_with_arg only throw exceptions with a single
argument?

MfG
        Goswin



Reply to: