-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path_exception.py
More file actions
30 lines (24 loc) · 832 Bytes
/
_exception.py
File metadata and controls
30 lines (24 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from enum import Enum
from uipath.runtime.errors import (
UiPathBaseRuntimeError,
UiPathErrorCategory,
UiPathErrorCode,
)
class McpErrorCode(Enum):
CONFIGURATION_ERROR = "CONFIGURATION_ERROR"
SERVER_NOT_FOUND = "SERVER_NOT_FOUND"
REGISTRATION_ERROR = "REGISTRATION_ERROR"
INITIALIZATION_ERROR = "INITIALIZATION_ERROR"
class UiPathMcpRuntimeError(UiPathBaseRuntimeError):
"""Custom exception for MCP runtime errors with structured error information."""
def __init__(
self,
code: McpErrorCode | UiPathErrorCode,
title: str,
detail: str,
category: UiPathErrorCategory = UiPathErrorCategory.UNKNOWN,
status: int | None = None,
):
super().__init__(
code.value, title, detail, category, status, prefix="UiPathMCP"
)