Improve error reporting in WriteTransactionsHandler