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:
2026-09-07 21:01:36 +02:00
parent 58c7fa147f
commit a5a8183663
2 changed files with 114 additions and 0 deletions

View File

@@ -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