~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/sftp.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-04-20 02:51:29 UTC
  • mfrom: (1662.1.16 bzr.mbp.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060420025129-8e219a634d2d4dbc
(mbp) #36963, #3619, #39657, other cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005 Robey Pointer <robey@lag.net>, Canonical Ltd
 
1
# Copyright (C) 2005 Robey Pointer <robey@lag.net>
 
2
# Copyright (C) 2005, 2006 Canonical Ltd
2
3
 
3
4
# This program is free software; you can redistribute it and/or modify
4
5
# it under the terms of the GNU General Public License as published by
34
35
                           FileExists, 
35
36
                           TransportNotPossible, NoSuchFile, PathNotChild,
36
37
                           TransportError,
37
 
                           LockError, ParamikoNotPresent
 
38
                           LockError, 
 
39
                           PathError,
 
40
                           ParamikoNotPresent,
38
41
                           )
39
42
from bzrlib.osutils import pathjoin, fancy_rename
40
43
from bzrlib.trace import mutter, warning, error
477
480
            self._translate_io_exception(e, path, ': unable to mkdir',
478
481
                failure_exc=FileExists)
479
482
 
480
 
    def _translate_io_exception(self, e, path, more_info='', failure_exc=NoSuchFile):
 
483
    def _translate_io_exception(self, e, path, more_info='', 
 
484
                                failure_exc=PathError):
481
485
        """Translate a paramiko or IOError into a friendlier exception.
482
486
 
483
487
        :param e: The original exception
487
491
        :param failure_exc: Paramiko has the super fun ability to raise completely
488
492
                           opaque errors that just set "e.args = ('Failure',)" with
489
493
                           no more information.
490
 
                           This sometimes means FileExists, but it also sometimes
491
 
                           means NoSuchFile
 
494
                           If this parameter is set, it defines the exception 
 
495
                           to raise in these cases.
492
496
        """
493
497
        # paramiko seems to generate detailless errors.
494
498
        self._translate_error(e, path, raise_generic=False)