Source code for SoftLayer.exceptions
"""
SoftLayer.exceptions
~~~~~~~~~~~~~~~~~~~~
Exceptions used throughout the library
:copyright: (c) 2013, SoftLayer Technologies, Inc. All rights reserved.
:license: BSD, see LICENSE for more details.
"""
[docs]class SoftLayerError(StandardError):
" The base SoftLayer error. "
[docs]class Unauthenticated(StandardError):
" Unauthenticated "
[docs]class SoftLayerAPIError(SoftLayerError):
""" SoftLayerAPIError is an exception raised whenever an error is returned
from the API.
Provides faultCode and faultString properties.
"""
def __init__(self, faultCode, faultString, *args):
SoftLayerError.__init__(self, faultString, *args)
self.faultCode = faultCode
self.reason = self.faultString = faultString
def __repr__(self):
return '<%s(%s): %s>' % \
(self.__class__.__name__, self.faultCode, self.faultString)
def __str__(self):
return '%s(%s): %s' % \
(self.__class__.__name__, self.faultCode, self.faultString)
[docs]class ParseError(SoftLayerAPIError):
" Parse Error "
[docs]class ServerError(SoftLayerAPIError):
" Server Error "
[docs]class ApplicationError(SoftLayerAPIError):
" Application Error "
[docs]class RemoteSystemError(SoftLayerAPIError):
" System Error "
[docs]class TransportError(SoftLayerAPIError):
" Transport Error "
[docs]class UnsupportedEncoding(ParseError):
pass
[docs]class InvalidCharacter(ParseError):
pass
[docs]class SpecViolation(ServerError):
pass
[docs]class MethodNotFound(ServerError):
pass
[docs]class InvalidMethodParameters(ServerError):
pass
[docs]class InternalError(ServerError):
pass
[docs]class DNSZoneNotFound(SoftLayerError):
pass