optimize error messages

This commit is contained in:
Yeuoly
2024-11-22 20:04:20 +08:00
parent 1443fd6739
commit 200f9af5d8
3 changed files with 114 additions and 53 deletions

View File

@ -4,6 +4,10 @@ class PluginDaemonError(Exception):
def __init__(self, description: str) -> None:
self.description = description
def __str__(self) -> str:
# returns the class name and description
return f"{self.__class__.__name__}: {self.description}"
class PluginDaemonInternalServerError(PluginDaemonError):
description: str = "Internal Server Error"