~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

(andrew) Fix tracebacks when receiving error responses to
        BzrDirFormat.initialize* RPCs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3049
3049
            return local_dir_format.initialize_on_transport(transport)
3050
3050
        client = _SmartClient(client_medium)
3051
3051
        path = client.remote_path_from_transport(transport)
3052
 
        response = client.call('BzrDirFormat.initialize', path)
 
3052
        try:
 
3053
            response = client.call('BzrDirFormat.initialize', path)
 
3054
        except errors.ErrorFromSmartServer, err:
 
3055
            remote._translate_error(err, path=path)
3053
3056
        if response[0] != 'ok':
3054
3057
            raise errors.SmartProtocolError('unexpected response code %s' % (response,))
3055
3058
        format = RemoteBzrDirFormat()
3115
3118
                stack_on_pwd=stack_on_pwd, repo_format_name=repo_format_name,
3116
3119
                make_working_trees=make_working_trees, shared_repo=shared_repo,
3117
3120
                vfs_only=True)
 
3121
        return self._initialize_on_transport_ex_rpc(client, path, transport,
 
3122
            use_existing_dir, create_prefix, force_new_repo, stacked_on,
 
3123
            stack_on_pwd, repo_format_name, make_working_trees, shared_repo)
 
3124
 
 
3125
    def _initialize_on_transport_ex_rpc(self, client, path, transport,
 
3126
        use_existing_dir, create_prefix, force_new_repo, stacked_on,
 
3127
        stack_on_pwd, repo_format_name, make_working_trees, shared_repo):
3118
3128
        args = []
3119
3129
        args.append(self._serialize_NoneTrueFalse(use_existing_dir))
3120
3130
        args.append(self._serialize_NoneTrueFalse(create_prefix))
3147
3157
                stack_on_pwd=stack_on_pwd, repo_format_name=repo_format_name,
3148
3158
                make_working_trees=make_working_trees, shared_repo=shared_repo,
3149
3159
                vfs_only=True)
 
3160
        except errors.ErrorFromSmartServer, err:
 
3161
            remote._translate_error(err, path=path)
3150
3162
        repo_path = response[0]
3151
3163
        bzrdir_name = response[6]
3152
3164
        require_stacking = response[7]