Skip to content

Commit f7a7542

Browse files
committed
Add NTAG service error contract
1 parent 19ac915 commit f7a7542

4 files changed

Lines changed: 470 additions & 53 deletions

File tree

src/schnee/services/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
"""Application services."""
2+
3+
from .base import ServiceError

src/schnee/services/base.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from abc import ABC, abstractmethod
2-
from typing import TypeVar
2+
from typing import ClassVar, TypeVar
33

44
from pydantic import BaseModel, ConfigDict
55

@@ -29,3 +29,12 @@ def call(cls, req: ReqType) -> T:
2929

3030
class Service[T](_ServiceCore[T]):
3131
"""Service base class"""
32+
33+
34+
class ServiceError(Exception):
35+
"""Base exception for service-layer errors."""
36+
37+
msg: ClassVar[str] = "Service error"
38+
39+
def __init__(self) -> None:
40+
super().__init__(self.msg)

0 commit comments

Comments
 (0)