-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexceptions.py
More file actions
102 lines (68 loc) · 2.69 KB
/
exceptions.py
File metadata and controls
102 lines (68 loc) · 2.69 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
"""
FUSE - (python dev tool) - Core App
exceptions.py - Exceptions
"""
# 3rd party imports
from typing import Any, Dict, Optional
class DevToolError(Exception):
"""Base exception for all FUSE errors."""
def __init__(self, message: str, details: Optional[Dict[str, Any]] = None):
super().__init__(message)
self.message = message
self.details = details or {}
class ConfigError(DevToolError):
"""Raised when there's a configuration error."""
pass
class ProcessError(DevToolError):
"""Raised when there's a process management error."""
def __init__(
self,
message: str,
process_id: Optional[str] = None,
exit_code: Optional[int] = None,
):
super().__init__(message)
self.process_id = process_id
self.exit_code = exit_code
class FrameworkError(DevToolError):
"""Raised when there's an error with the detected framework or Intergration error."""
def __init__(self, message: str, framework: Optional[str] = None):
super().__init__(message)
self.framework = framework
class DeploymentError(DevToolError):
"""Raised when there's an error with deployment."""
def __init__(self, message: str, platform: Optional[str] = None):
super().__init__(message)
self.platform = platform
class SecurityError(DevToolError):
"""Raised when there's an error with security-related operations."""
pass
class NetworkError(DevToolError):
"""Raised when there's an error with network-related operations."""
def __init__(
self, message: str, host: Optional[str] = None, port: Optional[int] = None
):
super().__init__(message)
self.host = host
self.port = port
class ServerError(DevToolError):
"""Raised when there's an error with server-related operations."""
def __init__(self, message: str, server_id: Optional[str] = None):
super().__init__(message)
self.server_id = server_id
self.message = message or {}
class FrameworkNotFoundError(DevToolError):
"""Raised when a framework is not found."""
def __init__(self, framework: str):
super().__init__(f"Framework {framework} not found or not supported")
self.framework = framework
class ProjectError(DevToolError):
"""Raised when there's an error with project-related operations."""
def __init__(self, message: str, project_id: Optional[str] = None):
super().__init__(message)
self.project_id = project_id
class LogError(DevToolError):
"""Raised when there's an error with log-related operations."""
def __init__(self, message: str):
super().__init__(message)
self.message = message or {}