mirror of
https://github.com/openSUSE/osc.git
synced 2025-08-05 07:03:38 +02:00
add an API error type of class to throw
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user