Implemented proper error handling for processing refunds.