Fix upload failure

The changes introduced to support folder annotation
broke upload error support.