Type guard checking if an error is a TransactionViolation.
Error to check
Optional
Optional specific cause to match
True if error is TransactionViolation with optional matching cause
Type guard checking if an error is a TransactionViolation.