~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-11-23 18:44:13 UTC
  • mfrom: (3006.2.5 win32.symlink.workaround)
  • Revision ID: pqm@pqm.ubuntu.com-20071123184413-m5uanmtvxcllbjee
Return error instead of a traceback when bzr is unable to create
 symlink on some platforms (e.g. on Windows). (workaround for #81689)

Show diffs side-by-side

added added

removed removed

Lines of Context:
252
252
        self.revision_id = revision_id
253
253
        self.branch = branch
254
254
 
 
255
 
255
256
class ReservedId(BzrError):
256
257
 
257
258
    _fmt = "Reserved revision-id {%(revision_id)s}"
2447
2448
        display_url = urlutils.unescape_for_display(
2448
2449
            tree.bzrdir.root_transport.base, 'ascii')
2449
2450
        BzrError.__init__(self, tree=tree, display_url=display_url)
 
2451
 
 
2452
 
 
2453
class UnableCreateSymlink(BzrError):
 
2454
 
 
2455
    _fmt = 'Unable to create symlink %(path_str)son this platform'
 
2456
 
 
2457
    def __init__(self, path=None):
 
2458
        path_str = ''
 
2459
        if path:
 
2460
            try:
 
2461
                path_str = repr(str(path))
 
2462
            except UnicodeEncodeError:
 
2463
                path_str = repr(path)
 
2464
            path_str += ' '
 
2465
        self.path_str = path_str