Ripped out the guts of exception handling for the upload to COSM.