1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

- LinkExpandError inherits from PackageError (display affected project and package in error message)

This commit is contained in:
Marcus Hüwe 2009-05-15 19:08:14 +00:00
parent 815ca58dc8
commit b5b04124c4
4 changed files with 13 additions and 11 deletions

View File

@ -72,7 +72,7 @@ def run(prg):
return 1
except oscerr.LinkExpandError, e:
print >>sys.stderr, 'Link cannot be expanded:\n', e
print >>sys.stderr, 'Link "%s/%s" cannot be expanded:\n' % (e.prj, e.pac), e.msg
print >>sys.stderr, 'Use "osc repairlink" to fix merge conflicts.\n'
return 1

View File

@ -1617,7 +1617,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print 'Updating %s' % p.name
if opts.expand_link and p.haslinkerror() and not p.islinkrepair():
raise oscerr.LinkExpandError(p.linkerror())
raise oscerr.LinkExpandError(p.prjname, p.name, p.linkerror())
if not rev:
if opts.expand_link and p.islink() and not p.isexpanded():

View File

@ -1906,7 +1906,7 @@ def show_upstream_xsrcmd5(apiurl, prj, pac, revision=None, linkrev=None, linkrep
li.read(li_node)
if li.haserror():
raise oscerr.LinkExpandError, li.error
raise oscerr.LinkExpandError(prj, pac, li.error)
return li.xsrcmd5

View File

@ -68,9 +68,18 @@ class WorkingCopyOutdated(OscBaseError):
'Looks as if you need to update it first.' \
% (self[0], self[1], self[2]))
class PackageError(OscBaseError):
"""Base class for all Package related exceptions"""
def __init__(self, prj, pac):
OscBaseError.__init__(self)
self.prj = prj
self.pac = pac
class LinkExpandError(OscBaseError):
class LinkExpandError(PackageError):
"""Exception raised when source link expansion fails"""
def __init__(self, prj, pac, msg):
PackageError.__init__(self, prj, pac)
self.msg = msg
class OscIOError(OscBaseError):
def __init__(self, e, msg):
@ -81,13 +90,6 @@ class OscIOError(OscBaseError):
class SignalInterrupt(Exception):
"""Exception raised on SIGTERM and SIGHUP."""
class PackageError(OscBaseError):
"""Base class for all Package related exceptions"""
def __init__(self, prj, pac):
OscBaseError.__init__(self)
self.prj = prj
self.pac = pac
class PackageExists(PackageError):
"""
Exception raised when a local object already exists