Re: Java bindings exceptions [was Re: Asking Help]
Olly Betts <[email protected]> Wed, 9 Aug 2017 23:40:35 +0100
| Newsgroups | gmane.comp.search.xapian.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Aug 09, 2017 at 11:09:55PM +0100, Olly Betts wrote:
> The Xapian exception classes aren't wrapped for Java at the moment, so
> currently you'll get a java.io.IOException exception, and you can check
> for DatabaseModifiedError using code like this (untested):
>
> try {
> // Code which might cause DatabaseModifiedError.
> } catch (Exception e) {
Sorry, that should be:
} catch (java.io.IOException e) {
> if (e.toString().startsWith("DatabaseModifiedError:")) {
> // Deal with it.
> }
> }
Cheers,
Olly