Coverage for sources/accretive/exceptions.py: 100%
17 statements
« prev ^ index » next coverage.py v7.5.4, created at 2024-07-07 15:48 +0000
« prev ^ index » next coverage.py v7.5.4, created at 2024-07-07 15:48 +0000
1# vim: set filetype=python fileencoding=utf-8:
2# -*- coding: utf-8 -*-
4#============================================================================#
5# #
6# Licensed under the Apache License, Version 2.0 (the "License"); #
7# you may not use this file except in compliance with the License. #
8# You may obtain a copy of the License at #
9# #
10# http://www.apache.org/licenses/LICENSE-2.0 #
11# #
12# Unless required by applicable law or agreed to in writing, software #
13# distributed under the License is distributed on an "AS IS" BASIS, #
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
15# See the License for the specific language governing permissions and #
16# limitations under the License. #
17# #
18#============================================================================#
21''' Family of exceptions for package API. '''
24from . import __ # pylint: disable=cyclic-import
25from . import _annotations as _a
26from . import classes as _classes # pylint: disable=cyclic-import
27from . import objects as _objects # pylint: disable=cyclic-import
30class _Class( __.ClassConcealerExtension, _classes.Class ): pass
33class Omniexception(
34 __.ConcealerExtension, _objects.Object, BaseException,
35 metaclass = _Class,
36):
37 ''' Base for exceptions raised by package API. '''
39 _attribute_visibility_includes_: _a.Collection[ str ] = (
40 frozenset( ( '__cause__', '__context__', ) ) )
43class IndelibleAttributeError( Omniexception, AttributeError, TypeError ):
44 ''' Attempt to reassign or delete indelible attribute. '''
46 def __init__( self, name: str ) -> None:
47 super( ).__init__(
48 f"Cannot reassign or delete existing attribute {name!r}." )
51class IndelibleEntryError( Omniexception, TypeError ):
52 ''' Attempt to update or remove indelible dictionary entry. '''
54 def __init__( self, indicator: _a.Any ) -> None:
55 super( ).__init__(
56 f"Cannot update or remove existing entry for {indicator!r}." )
59class InvalidOperationError( Omniexception, RuntimeError, TypeError ):
60 ''' Attempt to perform invalid operation. '''
62 def __init__( self, name: str ) -> None:
63 super( ).__init__( f"Cannot perform operation {name!r}." )
66__all__ = __.discover_public_attributes( globals( ) )