feat: add PipelineWarning for non-blocking pipeline errors (M10-U0)
Add PipelineWarning(PronoteSyncError) to the canonical error hierarchy. This non-blocking warning type is used by the XMPP channel (and future channels) to signal recoverable failures without breaking the pipeline. - PipelineWarning inherits from PronoteSyncError, not Warning builtin - Constructor: (message, step=None) with recoverable=True - 8 unit tests covering inheritance, raising, catching, attributes Co-authored-by: opencode/test-engineer <test-engineer@agents.invalid> Co-authored-by: opencode/coder <coder@agents.invalid>
This commit is contained in:
@@ -31,3 +31,29 @@ class PipelineCriticalError(PronoteSyncError):
|
||||
:param message: Message décrivant la cause de l'erreur critique.
|
||||
"""
|
||||
super().__init__(message)
|
||||
|
||||
|
||||
class PipelineWarning(PronoteSyncError):
|
||||
"""Avertissement non bloquant pour une erreur récupérable du pipeline.
|
||||
|
||||
Contrairement à :class:`PipelineCriticalError`, cet avertissement signale
|
||||
un problème récupérable : le pipeline peut poursuivre son exécution en
|
||||
mode dégradé.
|
||||
|
||||
Il hérite volontairement de :class:`PronoteSyncError` (et non de la classe
|
||||
native :class:`Warning`) afin de rester dans la hiérarchie canonique des
|
||||
erreurs du projet.
|
||||
|
||||
:ivar recoverable: Indique que l'erreur est récupérable (toujours ``True``).
|
||||
:ivar step: Étape du pipeline ayant produit l'avertissement.
|
||||
"""
|
||||
|
||||
def __init__(self, message: str, step: str | None = None) -> None:
|
||||
"""Initialise l'avertissement avec un message descriptif.
|
||||
|
||||
:param message: Message décrivant la cause de l'avertissement.
|
||||
:param step: Étape du pipeline ayant produit l'avertissement.
|
||||
"""
|
||||
super().__init__(message)
|
||||
self.recoverable = True
|
||||
self.step = step
|
||||
|
||||
Reference in New Issue
Block a user