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:
parent
be934cc16d
commit
3fb7530028
@ -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
|
||||
|
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user