Spaces:
Sleeping
Sleeping
| """ | |
| KCSC MCP ์ ํ๋ฆฌ์ผ์ด์ ์ ์ฌ์ฉ์ ์ ์ ์์ธ ํด๋์ค | |
| """ | |
| class KCSCBaseException(Exception): | |
| """KCSC ๊ด๋ จ ๋ชจ๋ ์์ธ์ ๊ธฐ๋ณธ ํด๋์ค""" | |
| def __init__(self, message, error_code=None): | |
| self.message = message | |
| self.error_code = error_code | |
| super().__init__(self.message) | |
| class APIError(KCSCBaseException): | |
| """API ํต์ ๊ด๋ จ ์ค๋ฅ""" | |
| def __init__(self, message, status_code=None, response=None): | |
| self.status_code = status_code | |
| self.response = response | |
| error_code = f"API-{status_code}" if status_code else "API-ERR" | |
| super().__init__(message, error_code) | |
| class ConfigError(KCSCBaseException): | |
| """์ค์ ๊ด๋ จ ์ค๋ฅ""" | |
| def __init__(self, message): | |
| super().__init__(message, "CONFIG-ERR") | |
| class VectorDBError(KCSCBaseException): | |
| """๋ฒกํฐ ๋ฐ์ดํฐ๋ฒ ์ด์ค ๊ด๋ จ ์ค๋ฅ""" | |
| def __init__(self, message, operation=None): | |
| self.operation = operation | |
| error_code = f"VECTDB-{operation}" if operation else "VECTDB-ERR" | |
| super().__init__(message, error_code) | |
| class MCPError(KCSCBaseException): | |
| """MCP ์ฒ๋ฆฌ ๊ด๋ จ ์ค๋ฅ""" | |
| def __init__(self, message, operation=None): | |
| self.operation = operation | |
| error_code = f"MCP-{operation}" if operation else "MCP-ERR" | |
| super().__init__(message, error_code) | |
| class DataProcessingError(KCSCBaseException): | |
| """๋ฐ์ดํฐ ์ฒ๋ฆฌ ๊ด๋ จ ์ค๋ฅ""" | |
| def __init__(self, message, data_type=None): | |
| self.data_type = data_type | |
| error_code = f"DATA-{data_type}" if data_type else "DATA-ERR" | |
| super().__init__(message, error_code) | |
| class AuthenticationError(KCSCBaseException): | |
| """์ธ์ฆ ๊ด๋ จ ์ค๋ฅ""" | |
| def __init__(self, message): | |
| super().__init__(message, "AUTH-ERR") | |