Is this the right event? Do we always get an abort event if an error occurs, or only if the transaction is explicitly aborted?  Is there also an onerror handler you could use?  I honestly don't know, but I suspect that it might be hard to test this code...