Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XPathException: checked or unchecked?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Nils_Kilden-Pedersen AT Countrywide.Com
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XPathException: checked or unchecked?
  • Date: Tue, 11 Jan 2005 14:49:17 -0800

xom-interest-bounces AT lists.ibiblio.org wrote on 01/08/2005 10:38:56 AM:

> On Jan 8, 2005, at 10:24 AM, Elliotte Harold wrote:
>
> > We're going to need an exception class for things that go wrong when
> > querying, ranging from syntactically incorrect queries to unexpected
> > engine runtime exceptions. Anyone feel like arguing whether this
> > exception should be checked or unchecked? I suspect the answer will
> > eventually become obvious, but right now I can see arguments on both
> > sides of the question.
>
> I recommend making it checked. That way you could later still relax it
> to unchecked if that should prove a very common case.

I would prefer the opposite.
Generally, unchecked gives the developer a choice.
Specifically, would anyone ever pass an XPath query they know might be
invalid? (There may be a rare case, and if so, they can catch the
exception).
And what am I supposed to do with unexpected engine runtime exceptions?

Nils
>From elharo AT metalab.unc.edu Tue Jan 11 18:36:02 2005
Return-Path: <elharo AT metalab.unc.edu>
X-Original-To: xom-interest AT lists.ibiblio.org
Delivered-To: xom-interest AT lists.ibiblio.org
Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206])
by lists.ibiblio.org (Postfix) with ESMTP id 00AFE4C005
for <xom-interest AT lists.ibiblio.org>;
Tue, 11 Jan 2005 18:36:01 -0500 (EST)
Received: (qmail 30409 invoked from network); 11 Jan 2005 23:36:01 -0000
Received: from dsl254-067-087.nyc1.dsl.speakeasy.net (HELO [192.168.254.100])
(elharo@[216.254.67.87]) (envelope-sender <elharo AT metalab.unc.edu>)
by mail6.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted
SMTP
for <Nils_Kilden-Pedersen AT Countrywide.Com>; 11 Jan 2005 23:36:01 -0000
Message-ID: <41E462E0.6000105 AT metalab.unc.edu>
Date: Tue, 11 Jan 2005 18:36:00 -0500
From: Elliotte Harold <elharo AT metalab.unc.edu>
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US;
rv:1.7.3) Gecko/20040910
X-Accept-Language: en-us, en, fr
MIME-Version: 1.0
To: Nils_Kilden-Pedersen AT Countrywide.Com
Subject: Re: [XOM-interest] XPathException: checked or unchecked?
References:
<OF86239B09.ED93007E-ON88256F86.006C7E77-88256F86.007D5F42 AT countrywide.com>
In-Reply-To:
<OF86239B09.ED93007E-ON88256F86.006C7E77-88256F86.007D5F42 AT countrywide.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Cc: xom-interest AT lists.ibiblio.org
X-BeenThere: xom-interest AT lists.ibiblio.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: xom-interest.lists.ibiblio.org
List-Unsubscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=unsubscribe>
List-Archive: <https://lists.ibiblio.org/sympa/arc/xom-interest>
List-Post: <mailto:xom-interest AT lists.ibiblio.org>
List-Help: <mailto:sympa AT lists.ibiblio.org?subject=HELP>
List-Subscribe: <http://lists.ibiblio.org/mailman/listinfo/xom-interest>,
<mailto:xom-interest-request AT lists.ibiblio.org?subject=subscribe>
X-List-Received-Date: Tue, 11 Jan 2005 23:36:02 -0000

Nils_Kilden-Pedersen AT Countrywide.Com wrote:


> And what am I supposed to do with unexpected engine runtime exceptions?

I'm checking on this, but I think the only exception that should be
thrown out of the query methods is XPathException. If I discover that
the engine can throw runtime exceptions, I'll catch those too and
convert them to XPathExceptions. I probably won't catch any errors, in
the unlikely event of an OutOfMemoryError, StackOverflowError or some such.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page