Error handling for upload.