File Upload Roll Back?

I'm working on a more robust file upload API for my site, but do not yet have a good solution for rolling back (deleting) files that were successfully uploaded if the database transactions did not complete successfully. I've wrapped the database steps in a transaction, but don't know how to test if the transaction was successful. Here's the basic idea of the API logic...

Files are uploaded and written to disk if they pass validation. A transaction is created to ensure data consistency as the Repeat loops through each file, checking its type and inserting into the appropriate table. (i was setting variables in each Condition to see the actual string of the file's "type"). If there's an error, then the Transaction should prevent any inconsistent data writes to the DB.

The Transaction component however does't appear to offer an exit status. So how would I know that the files now need to be deleted from disk if Transaction does a roll back?

Can I test for the Transaction exit status?

If I'm not mistaken, if a transaction fails an error is raised (i.e. an Exception is thrown), meaning you can use Try/Catch

Cool. Try/Catch working...thanks @Apple

If the transaction fails, I repeat through the original File Upload, removing each file if it exists on disk. Interesting thing though...

The repeat's dynamic picker for the file roll back (the CATCH) presents the following:

The $name variable's value is "0". I need the path to the file for the delete operation, and that was found within the $value object as $value.path (as I highlighted in the first screenshot). I would not have known this if I didn't use Set Value to see what was going on.