mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-13 09:16:14 +01:00
- babysitter: catch ServiceRuntimeError
Note: it is probably better to raise a ServiceRuntimeError in Serviceinfo.execute instead of Package.commit because "execute" has all the information about the failing service...
This commit is contained in:
parent
1176983a9a
commit
1614123f82
@ -165,6 +165,8 @@ def run(prg, argv=None):
|
||||
except oscerr.ExtRuntimeError as e:
|
||||
print(e.file + ':', e.msg, file=sys.stderr)
|
||||
return 1
|
||||
except oscerr.ServiceRuntimeError as e:
|
||||
print(e.msg, file=sys.stderr)
|
||||
except oscerr.WorkingCopyOutdated as e:
|
||||
print(e, file=sys.stderr)
|
||||
return 1
|
||||
|
@ -1305,7 +1305,9 @@ class Package:
|
||||
if not skip_local_service_run:
|
||||
r = self.run_source_services(mode="trylocal", verbose=verbose)
|
||||
if r is not 0:
|
||||
raise oscerr.ServiceRuntimeError(r)
|
||||
# FIXME: it is better to raise this in Serviceinfo.execute with more
|
||||
# information (like which service/command failed)
|
||||
raise oscerr.ServiceRuntimeError('A service failed with error: %d' % r)
|
||||
|
||||
if not self.todo:
|
||||
self.todo = [i for i in self.to_be_added if not i in self.filenamelist] + self.filenamelist
|
||||
|
Loading…
Reference in New Issue
Block a user