mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-04 10:36:17 +01:00
- LinkExpandError inherits from PackageError (display affected project and package in error message)
This commit is contained in:
parent
815ca58dc8
commit
b5b04124c4
@ -72,7 +72,7 @@ def run(prg):
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
except oscerr.LinkExpandError, e:
|
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'
|
print >>sys.stderr, 'Use "osc repairlink" to fix merge conflicts.\n'
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
@ -1617,7 +1617,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
print 'Updating %s' % p.name
|
print 'Updating %s' % p.name
|
||||||
|
|
||||||
if opts.expand_link and p.haslinkerror() and not p.islinkrepair():
|
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 not rev:
|
||||||
if opts.expand_link and p.islink() and not p.isexpanded():
|
if opts.expand_link and p.islink() and not p.isexpanded():
|
||||||
|
@ -1906,7 +1906,7 @@ def show_upstream_xsrcmd5(apiurl, prj, pac, revision=None, linkrev=None, linkrep
|
|||||||
li.read(li_node)
|
li.read(li_node)
|
||||||
|
|
||||||
if li.haserror():
|
if li.haserror():
|
||||||
raise oscerr.LinkExpandError, li.error
|
raise oscerr.LinkExpandError(prj, pac, li.error)
|
||||||
return li.xsrcmd5
|
return li.xsrcmd5
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,9 +68,18 @@ class WorkingCopyOutdated(OscBaseError):
|
|||||||
'Looks as if you need to update it first.' \
|
'Looks as if you need to update it first.' \
|
||||||
% (self[0], self[1], self[2]))
|
% (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"""
|
"""Exception raised when source link expansion fails"""
|
||||||
|
def __init__(self, prj, pac, msg):
|
||||||
|
PackageError.__init__(self, prj, pac)
|
||||||
|
self.msg = msg
|
||||||
|
|
||||||
class OscIOError(OscBaseError):
|
class OscIOError(OscBaseError):
|
||||||
def __init__(self, e, msg):
|
def __init__(self, e, msg):
|
||||||
@ -81,13 +90,6 @@ class OscIOError(OscBaseError):
|
|||||||
class SignalInterrupt(Exception):
|
class SignalInterrupt(Exception):
|
||||||
"""Exception raised on SIGTERM and SIGHUP."""
|
"""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):
|
class PackageExists(PackageError):
|
||||||
"""
|
"""
|
||||||
Exception raised when a local object already exists
|
Exception raised when a local object already exists
|
||||||
|
Loading…
Reference in New Issue
Block a user