[scriptindex] Drop fallback if replace_document fails
commit0e66fa519b517dddffd481d0ffa05977b0b06ec7
authorOlly Betts <olly@survex.com>
Thu, 13 Sep 2018 02:58:21 +0000 (13 14:58 +1200)
committerOlly Betts <olly@survex.com>
Fri, 14 Sep 2018 00:38:45 +0000 (14 12:38 +1200)
tree4d1d863656681bc7cf7b605914bef78bb9608151
parentc057fc87ddbc0e4cbde7a65040c5f844da6cf504
[scriptindex] Drop fallback if replace_document fails

Ever since the initial version of scriptindex.cc added back in 2002
by 782e9d06729866aefa3fa8a1161d0ac4d6db5981 there's been code to
catch Xapian:Error from replace_document() and fall back to using
add_document() with the comment:

Possibly the document was deleted by another process in the meantime...?

This comment doesn't make any sense as we only support a single writer
at a time.  Digging back further in the history, there's similar code in
the old "indexnasty" example which scriptindex was a replacement for,
so this probably just comes from a time before we'd entirely settled
on the single writer model.

The only exception which modern WritableDatabase::replace_document()
can throw which it would be useful to do this for is
Xapian::InvalidArgumentError if a zero docid is specified, but we
explicitly exclude that case before calling replace_document().

(cherry picked from commit c13e36d4c29c64b13e4d43ae5af49b81571d0e0f)
xapian-applications/omega/scriptindex.cc