W3C home > Mailing lists > Public > xproc-dev@w3.org > September 2011

Re: Saxon exception in core Calabash interface

From: Florent Georges <fgeorges@fgeorges.org>
Date: Thu, 1 Sep 2011 15:41:15 +0200
Message-ID: <CADyR_r1_zv8_3YFYCtK+d7b9Nh3qKeMZFDc2=KB8mGDR=7UC+g@mail.gmail.com>
To: Norman Walsh <ndw@nwalsh.com>
Cc: XProc Dev <xproc-dev@w3.org>
On 1 September 2011 14:27, Norman Walsh wrote:
> Florent Georges writes:

>>   Why not defining an XProcException or CalabashException?

> Because SaxonApiException is a checked exception.  I suppose I
> could remove it from XProcRunnable, but then every
> implementation will have to add an explicit try/catch block.
> Blech.

  Ok, I think I understand...  Because this exception has become the
exception thrown by most of the Calabash machinery, even if you don't
use Saxon directly you are actually using it through e.g.
ReadablePipe.read().  I guess the Object-Oriented Principles (or Java
usual practices?) would say to rather define your own checked
exception and stack inner exceptions into your new exception.

  My concern was about something like the following:

    try {
        use, say, marklogic
    catch ( marklogic exception ) {
        throw new SaxonApiException("feels weird"):

  But in the meanwhile, I discovered that XProcException is a
non-checked exception, so you can always throw one from run().  So
that's ok I guess.

> Tell you what, I'll do better in V2, ok? :-)

  Even better?  You bet I'm ok :-)

Florent Georges
Received on Thursday, 1 September 2011 13:42:12 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:08 UTC