Source code for cpauto.core.exceptions

# -*- coding: utf-8 -*-

# Copyright 2016 Dana James Traversie and Check Point Software Technologies, Ltd. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# cpcauto.core.exceptions
# ~~~~~~~~~~~~~~~~~~~~~~~

"""This module contains the set of cpauto core exceptions."""

[docs]class Error(IOError): """Base class for exceptions in this module.""" pass
[docs]class WebClientError(Error): """Exception raised when a web client runs into trouble.""" def __init__(self, message, http_status_code=None): super(WebClientError, self).__init__(message) self.http_status_code = http_status_code
[docs]class CoreClientError(WebClientError): """Exception raised when an core web client runs into trouble.""" pass
[docs]class WaitOnTaskError(CoreClientError): """An error occurred whilst waiting on a task or tasks.""" pass
[docs]class ConnectionError(CoreClientError): """A connection error occurred.""" pass
[docs]class HTTPError(CoreClientError): """An HTTP error occurred.""" pass
[docs]class SSLError(CoreClientError): """An SSL error occurred.""" pass
[docs]class Timeout(CoreClientError): """The request timed out.""" pass
[docs]class TooManyRedirects(CoreClientError): """Too many redirects.""" pass
[docs]class InvalidURL(CoreClientError, ValueError): """The URL provided was invalid.""" pass