Comment 2 for bug 722143

Revision history for this message
Curtis Hovey (sinzui) wrote :

Both TB take the same path through the code:
  Module lazr.restful._resource, line 928, in __call__
    result = self.do_POST()
  Module lazr.restful._resource, line 765, in do_POST
    return self.handleCustomPOST(operation_name)
  Module lazr.restful._resource, line 1371, in handleCustomPOST
    value = super(EntryResource, self).handleCustomPOST(operation_name)
  Module lazr.restful._resource, line 749, in handleCustomPOST
    return operation()
  Module lazr.restful._operation, line 83, in __call__
    response = self.call(**values)
  Module lazr.restful.declarations, line 1210, in call
    result = self._getMethod()(**params)
  Module lp.code.model.branch, line 963, in requestMirror
    raise BranchTypeError(self.unique_name)
BranchTypeError: ~bzr-explorer-dev/bzr-explorer/trunk

The code does this:

    def requestMirror(self):
        """See `IBranch`."""
        if self.branch_type in (BranchType.REMOTE, BranchType.HOSTED):
            raise BranchTypeError(self.unique_name)

It looks like this method cannot be used a remote branch. This error should be converted to a HTTP code and the method documentation should make it clear the branch most be MIRRORED or IMPORTED.