From 4ef972fd535b9012bbfac1b16d8cd75d2aa9cf92 Mon Sep 17 00:00:00 2001 From: openclaw Date: Mon, 23 Mar 2026 15:43:37 +0000 Subject: [PATCH] feat(shared): add kernel exceptions --- .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 172 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 179 bytes .../__pycache__/exceptions.cpython-312.pyc | Bin 0 -> 1684 bytes backend/app/shared/kernel/exceptions.py | 18 ++++++++++++++++++ 4 files changed, 18 insertions(+) create mode 100644 backend/app/shared/__pycache__/__init__.cpython-312.pyc create mode 100644 backend/app/shared/kernel/__pycache__/__init__.cpython-312.pyc create mode 100644 backend/app/shared/kernel/__pycache__/exceptions.cpython-312.pyc diff --git a/backend/app/shared/__pycache__/__init__.cpython-312.pyc b/backend/app/shared/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b6f16e377918007e3b8fc1ef7409e8f9486fb78 GIT binary patch literal 172 zcmX@j%ge<81Z?&PGePuY5P=Rpvj9b=GgLBYGWxA#C}INgK7-W!^42fUFUl@1NK8)E zPb^B#&`n7#&P>nKO-xVCE72{^&dkZtO-U@yNXkzvO3_bBOwLZtOVLj(D9|s?NGwWC t(T|VM%*!l^kJl@x{Ka9Do1apelWJGQ3N)J$h>JmtkIamWj77{q765BIE5-l- literal 0 HcmV?d00001 diff --git a/backend/app/shared/kernel/__pycache__/__init__.cpython-312.pyc b/backend/app/shared/kernel/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f2208504b10dc433cc476749b4b40364c58b2fd2 GIT binary patch literal 179 zcmX@j%ge<81Z?&PGePuY5P=Rpvj9b=GgLBYGWxA#C}INgK7-W!3eqpnFUl@1NK8)E zPb^B#&`n7#&P>nKO-xVCE72{^&dkZtO-U@yNXkzvO3_bBOwLZtOVLj(D9|s?NGwWC z(a%mT%1h1BkB`sH%PfhH*DI*}#bJ}1pHiBWYFESxw1N?ci$RQ!%#4hTMa)1J0NTec AeEAmq6rb5$J2u!!6XgRCENKqw2$t@yK#-h{vl0Y4xwxP!+>DmpF_mcsmG-?i@6E@X-|xNo zH=jR2;QNQY_7@C7-r*qmQhlSl2*y)lkn6-F8^oiWyfk&JLY3D5uQ}i~l-B}pYQSqY z(}fW?*&TJdKj>Zr;~|{ENrif(V!#=uXTWcIRyDmzs?#p)s2OLqX1*7v1&E?5E=3p_7Q$wr-vIK!A9 z`VnIVE4CyLssmH9jJbg$C1VoT*|xp@`Bw2>O{~be)e4$&dL=( z2xdJ;F5j*>!Ykf(+!Y>rMW&N23P!wLEkQ$|7^ALskGb$JjlwoAoHJQ(r(P2@ldq(}+$$r%uz zHpqctrsj9#0Rh$4suO+0(R&mE_|c1oiY(!frkI4aB7*`c0tdFH z_9}Sr04NI$kYaJ_NQ#F%VpQUO$m8T$ATW1G;N*VhyoPEN_aDcp1ISOH69r}>PlHg% z8>yKW<^ciKwmzbIk3#Q*vxgx6p1vMi^aH-slo4Omuv>K}TGlXV;1P%9LyrRf4=|1c z|E+e0R>p=lR6|=sl$hnUaZE+3RBVo~jO|4BnxUE-fjP>Ur5XD_q-aapd62gwcRb{6 z40e_H7$R@uQ@~sH2z`5}iyf literal 0 HcmV?d00001 diff --git a/backend/app/shared/kernel/exceptions.py b/backend/app/shared/kernel/exceptions.py index e69de29..b40ebb5 100644 --- a/backend/app/shared/kernel/exceptions.py +++ b/backend/app/shared/kernel/exceptions.py @@ -0,0 +1,18 @@ +class NotFoundError(Exception): + def __init__(self, entity: str, entity_id: str) -> None: + self.entity = entity + self.entity_id = entity_id + super().__init__(f"{entity} not found: {entity_id}") + + +class ValidationError(Exception): + def __init__(self, message: str) -> None: + self.message = message + super().__init__(message) + + +class FileSystemError(Exception): + def __init__(self, path: str, message: str) -> None: + self.path = path + self.message = message + super().__init__(f"Filesystem error at {path}: {message}")