make TransactionError immutable

small refactoring to make transaction processing more robust