2025-10-24 23:10:22 +08:00

32 lines
719 B
Python

# Copyright (c) 2025, JINGROW and contributors
# For license information, please see license.txt
"""
Jingrow Local 异常定义
与 SaaS 版完全一致的异常处理
"""
class JingrowException(Exception):
"""Jingrow 基础异常"""
def __init__(self, title: str, message: str):
self.title = title
self.message = message
super().__init__(f"[{title}] {message}")
class ValidationError(JingrowException):
"""验证错误"""
pass
class PermissionError(JingrowException):
"""权限错误"""
pass
class DoesNotExistError(JingrowException):
"""文档不存在错误"""
pass
class DuplicateEntryError(JingrowException):
"""重复条目错误"""
pass