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

add an API error type of class to throw

This commit is contained in:
Dirk Mueller 2008-06-20 13:36:45 +00:00
parent be934cc16d
commit 3fb7530028
2 changed files with 10 additions and 0 deletions

View File

@ -62,6 +62,10 @@ def run(prg):
print >>sys.stderr, 'aborted.'
return 1
except oscerr.APIError, e:
print >>sys.stderr, 'BuildService API error:', e.msg
return 1
except oscerr.UnreadableFile, e:
print >>sys.stderr, e.msg
return 1

View File

@ -23,6 +23,12 @@ class ConfigError(OscBaseError):
OscBaseError.__init__(self)
self.msg = msg
class APIError(OscBaseError):
"""Exception raised when there is an error in the output from the API"""
def __init__(self, msg):
OscBaseError.__init__(self)
self.msg = msg
class NoConfigfile(OscBaseError):
"""Exception raised when osc's configfile cannot be found"""
def __init__(self, fname, msg):