Re: [PATCH 1/3] ruby: add new Database.open_with_config

2021-06-28 Thread David Bremner
Felipe Contreras  writes:

> On Sun, Jun 27, 2021 at 1:02 PM David Bremner  wrote:
>>
>> Felipe Contreras  writes:
>>
>> > +ret = notmuch_database_open_with_config (database_path, mode,
>> > +  config_path, profile, &db,
>> > +  NULL);
>>
>> I'm curious why you ignore the error_message ouput parameter. Of course
>> it's valid and supported for library users to do this, but this way
>> there is no way for users of the ruby bindings to retrieve the
>> additional information about the error. Particularly in the case of
>> Xapian exceptions, this can be helpful for debugging.
>
> Because the patch is complex enough as it is. It shouldn't be that
> difficult to add a new notmuch_rb_status_raise function that takes an
> error message and produces a proper Ruby exception with that message,
> but that should be done in a separate patch.
>

Agreed.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH 1/3] ruby: add new Database.open_with_config

2021-06-27 Thread Felipe Contreras
On Sun, Jun 27, 2021 at 1:02 PM David Bremner  wrote:
>
> Felipe Contreras  writes:
>
> > +ret = notmuch_database_open_with_config (database_path, mode,
> > +  config_path, profile, &db,
> > +  NULL);
>
> I'm curious why you ignore the error_message ouput parameter. Of course
> it's valid and supported for library users to do this, but this way
> there is no way for users of the ruby bindings to retrieve the
> additional information about the error. Particularly in the case of
> Xapian exceptions, this can be helpful for debugging.

Because the patch is complex enough as it is. It shouldn't be that
difficult to add a new notmuch_rb_status_raise function that takes an
error message and produces a proper Ruby exception with that message,
but that should be done in a separate patch.

-- 
Felipe Contreras
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH 1/3] ruby: add new Database.open_with_config

2021-06-27 Thread David Bremner
Felipe Contreras  writes:

> +ret = notmuch_database_open_with_config (database_path, mode,
> +  config_path, profile, &db,
> +  NULL);

I'm curious why you ignore the error_message ouput parameter. Of course
it's valid and supported for library users to do this, but this way
there is no way for users of the ruby bindings to retrieve the
additional information about the error. Particularly in the case of
Xapian exceptions, this can be helpful for debugging.

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org