i would rewrite `save_to_repo` so that this can be written:

```python
return save_to_repo(resource_id, self.storage, code=code, location=location, object=resource, error=error)
```

(with `save_to_repo` checking its first two args, etc.)