Return-Path: Delivered-To: apmail-incubator-lucy-dev-archive@www.apache.org Received: (qmail 67179 invoked from network); 8 Jan 2011 11:30:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Jan 2011 11:30:01 -0000 Received: (qmail 2757 invoked by uid 500); 8 Jan 2011 11:30:00 -0000 Delivered-To: apmail-incubator-lucy-dev-archive@incubator.apache.org Received: (qmail 2680 invoked by uid 500); 8 Jan 2011 11:29:59 -0000 Mailing-List: contact lucy-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucy-dev@incubator.apache.org Delivered-To: mailing list lucy-dev@incubator.apache.org Received: (qmail 2671 invoked by uid 99); 8 Jan 2011 11:29:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Jan 2011 11:29:58 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [209.98.116.241] (HELO pekmac.local) (209.98.116.241) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Jan 2011 11:29:53 +0000 Received: from pekmac.local (localhost [127.0.0.1]) by pekmac.local (Postfix) with ESMTP id 4A8552A530C for ; Sat, 8 Jan 2011 05:29:32 -0600 (CST) Message-ID: <4D284A9C.1020303@peknet.com> Date: Sat, 08 Jan 2011 05:29:32 -0600 From: Peter Karman Reply-To: peter@peknet.com User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: lucy-dev@incubator.apache.org References: <20110107033141.GA26919@rectangular.com> In-Reply-To: <20110107033141.GA26919@rectangular.com> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [lucy-dev] Error reporting in allot_params Marvin Humphrey wrote on 1/6/11 9:31 PM: > If we change allot_params() to return false and store an exception object in > Err_error on failure, then the calling code can RETHROW the exception... > > bool_t args_ok = XSBind_allot_params( &(ST(0)), 1, > items, "Lucy::Search::IndexSearcher::new_PARAMS", > &index_sv, "index", 5, > NULL); > if (!args_ok) { > RETHROW(INCREF(Err_get_error())); > } > > ... so that we see its location in the stack trace instead. > > Invalid parameter: 'bogus' > cfish_XSBind_allot_params at xs/XSBind.c line 408 > XS_Lucy_Search_IndexSearcher_new at lib/Lucy.xs line 1647 > at foo.t line 5 > > "XS_Lucy_Search_IndexSearcher_new" isn't quite as good as > "Lucy::Search::IndexSearcher::new", but it's better than nothing. > +1 -- Peter Karman . http://peknet.com/ . peter@peknet.com