fitzzftw.patch.exceptions¶
---
config:
height: 300px
width: 300px
title: exceptions
---
classDiagram
Exception <|-- FtwException
FtwError <|-- FtwPatchError
FtwError <|-- FtwProtocolError
FtwException <|-- FtwError
FtwPatchError <|-- PatchParseError
TypeError <|-- FtwProtocolError
Inheritage diagramm for exceptions¶
exceptions¶
This module provides a specialized hierarchy of exceptions for the fitzzftw framework. It includes advanced introspection tools that adapt to the running Python version to handle Protocols and callables.
Core Features:¶
Protocol Validation: Uses
FtwProtocolWrapandFtwProtocolErrorto generate highly detailed error messages when objects do not match required interfaces.Signature Inspection: Employs
fitzzftw.patch.current_312_313..FtwMethFuncWrapto accurately represent methods and functions (including ‘self’ injection) in diagnostic outputs.Type Awareness: Automatically resolves type names and hints into human-readable strings for clearer debugging.
The primary goal of this module is to provide actionable implementation guides for the developer by resolving version-specific introspection differences (PEP 649/annotationlib vs. legacy typing).
Functions
|
Constructs a detailed, human-readable error message for protocol violations. |
- protocol_error_message(obj, argument, *protocols)[source]¶
Constructs a detailed, human-readable error message for protocol violations.
The message identifies the failing function and argument, then lists the requirements of the expected protocols (both data attributes and methods). It provides a clear blueprint of what needs to be implemented or overridden.
- Parameters:
- Returns:
A formatted string containing the error details and requirements.
- Return type:
Exceptions
Base exception for all errors raised by the |
|
Base exception for all exceptions raised by the |
|
Base exception for all errors raised by the |
|
Exception raised when an object violates one or more required Protocols. |
|
Exception raised when an error occurs during the parsing of the patch file content. |
- exception FtwError[source]¶
Bases:
FtwExceptionBase exception for all errors raised by the
fitzzftwnamespace.- Inheritance Hierarchy
- exception FtwException[source]¶
Bases:
ExceptionBase exception for all exceptions raised by the
ftwmodule.- Inheritance Hierarchy
- exception FtwPatchError[source]¶
Bases:
FtwErrorBase exception for all errors raised by the
ftw_patchmodule.- Inheritance Hierarchy
- exception FtwProtocolError[source]¶
-
Exception raised when an object violates one or more required Protocols.
This error is specifically designed to work with the FtwProtocolWrap and FtwMethFuncWrap utilities. It captures the context of the failure—including the target function, the invalid argument, and the expected protocols—to generate a highly detailed cryptographic-style error message.
Inheritance Hierarchy
- Variables:
- exception PatchParseError[source]¶
Bases:
FtwPatchErrorException raised when an error occurs during the parsing of the patch file content.
- Inheritance Hierarchy