python-masakariclient/masakariclient/common/exception.py
openstack 2475bf1ba2 Display progress_details of the notification
Added 1.1 microversion support which will display `progress_details`
of the notification.

Note: Referred APIVersion class from python-novaclient [1].

[1]: https://github.com/openstack/python-novaclient/blob/master/novaclient/api_versions.py#L42

Depends-On: I93c1b7d88823e02d9a02855cabb8b22c9e40a7d5
Implements: bp progress-details-recovery-workflows
Change-Id: I9ba787bc8ef9528a7cff5b4c1411dffa454b66d2
2019-03-08 07:20:00 +00:00

32 lines
1003 B
Python

# Copyright(c) 2016 Nippon Telegraph and Telephone Corporation
#
# 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.
class BaseException(Exception):
"""An error occurred."""
def __init__(self, message=None):
self.message = message
def __str__(self):
return self.message or self.__class__.__doc__
class CommandError(BaseException):
"""Invalid usage of CLI."""
class UnsupportedVersion(Exception):
"""User is trying to use an unsupported version of the API."""
pass