Reviewing Stored Procedure template for handling transaction?
It might be worth looking at XACT_STATE instead of @@TRANCOUNT.

From BOL:


  Both the XACT_STATE and @@TRANCOUNT functions can be used to detect
  whether the current request has an active user transaction.
  @@TRANCOUNT cannot be used to determine whether that transaction has
  been classified as an uncommittable transaction.


So there may be some cases where, even though there was an error, the transaction should still be committed to the database.

IF (XACT_STATE()) = -1
BEGIN
    PRINT 'The transaction is in an uncommittable state.' +
          ' Rolling back transaction.'
    ROLLBACK TRANSACTION;
END;

-- Test whether the transaction is active and valid.
IF (XACT_STATE()) = 1
BEGIN
    PRINT 'The transaction is committable.' + 
          ' Committing transaction.'
    COMMIT TRANSACTION;   
END;


Of course, it's entirely up to you whether you want to commit any transaction where an error was raised, even if it is committable... Just because you can, doesn't mean it's always a good idea!