fix: Handle upload error correctly