/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/versionedfile.py

  • Committer: John Arbash Meinel
  • Date: 2009-07-15 16:52:26 UTC
  • mto: This revision was merged to the branch mainline in revision 4560.
  • Revision ID: john@arbash-meinel.com-20090715165226-ot2qb72eexefm2im
Add AbsentContentFactory.get_bytes_as()

This at least gives us an exception that describes what key is missing,
rather than giving us a generic 'AttributeError'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
        self.key = key
176
176
        self.parents = None
177
177
 
 
178
    def get_bytes_as(self, storage_kind):
 
179
        raise ValueError('A request was made for key: %s, but that'
 
180
                         ' content is not available, and the calling'
 
181
                         ' code does not handle if it is missing.'
 
182
                         % (self.key,))
 
183
 
178
184
 
179
185
class AdapterFactory(ContentFactory):
180
186
    """A content factory to adapt between key prefix's."""