Coverage for sources/classcore/exceptions.py: 93%
14 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-29 23:23 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-29 23:23 +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''' Exceptions from package. '''
24from __future__ import annotations
26from . import __
27from . import standard as _standard
30class Omniexception( # pyright: ignore[reportGeneralTypeIssues]
31 BaseException, _standard.Object,
32 instances_visibles = ( '__cause__', '__context__' ), # pyright: ignore[reportCallIssue]
33):
34 ''' Base exception for package. '''
37class Omnierror( Exception, Omniexception ):
38 ''' Base error for package. '''
41class AttributeImmutability( AttributeError, Omnierror ):
43 def __init__( self, name: str, target: str ):
44 super( ).__init__(
45 f"Could not assign or delete attribute {name!r} on {target}." )
48class BehaviorExclusionInvalidity( TypeError, ValueError, Omnierror ):
50 def __init__( self, verifier: __.typx.Any ):
51 super( ).__init__(
52 f"Invalid behavior exclusion verifier: {verifier!r}" )
55class ErrorProvideFailure( RuntimeError, Omnierror ):
57 def __init__( self, name: str, reason: str ):
58 super( ).__init__(
59 f"Could not provide error class {name!r}. Reason: {reason}" )