Exemplo n.º 1
0
class ApiException(Exception):
    """Base FortiOS API Client Exception.

    To correctly use this class, inherit from it and define
    a 'message' property. That message will get printf'd
    with the keyword arguments provided to the constructor.

    """
    message = _("An unknown exception occurred.")

    def __init__(self, **kwargs):
        try:
            self._error_string = self.message % kwargs
        except Exception:
            # at least get the core message out if something happened
            self._error_string = self.message

    def __str__(self):
        return self._error_string
Exemplo n.º 2
0
class InvalidSecurityCertificate(BadRequest):
    message = _("The backend received an invalid security certificate.")
Exemplo n.º 3
0
class BadRequest(ApiException):
    message = _("The server is unable to fulfill the request due "
                "to a bad syntax")
Exemplo n.º 4
0
class RequestTimeout(ApiException):
    message = _("The request has timed out.")
Exemplo n.º 5
0
class ReadOnlyMode(Forbidden):
    message = _("Create/Update actions are forbidden when in read-only mode.")
Exemplo n.º 6
0
class Forbidden(ApiException):
    message = _("The request is forbidden from accessing the "
                "referenced resource.")
Exemplo n.º 7
0
class ServiceUnavailable(ApiException):
    message = _("Request could not completed because the associated "
                "resource could not be reached.")
Exemplo n.º 8
0
class Failed_dependency(ApiException):
    message = _("Request failed dependency.")
Exemplo n.º 9
0
class Conflict(ApiException):
    message = _("Request conflicts with configuration on a different "
                "entity.")
Exemplo n.º 10
0
class ResourceNotFound(ApiException):
    message = _("An entity referenced in the request was not found.")
Exemplo n.º 11
0
class UnAuthorizedRequest(ApiException):
    message = _("Server denied session's authentication credentials.")