-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy patherrors.py
More file actions
48 lines (31 loc) · 1.13 KB
/
errors.py
File metadata and controls
48 lines (31 loc) · 1.13 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
"""Traccia SDK error hierarchy and exceptions."""
from __future__ import annotations
class TracciaError(Exception):
"""Base exception for all Traccia SDK errors."""
def __init__(self, message: str, details: dict = None):
super().__init__(message)
self.message = message
self.details = details or {}
def __str__(self) -> str:
if self.details:
details_str = ", ".join(f"{k}={v}" for k, v in self.details.items())
return f"{self.message} ({details_str})"
return self.message
class ConfigError(TracciaError):
"""Raised when configuration is invalid or conflicting."""
pass
class ValidationError(TracciaError):
"""Raised when validation fails."""
pass
class ExportError(TracciaError):
"""Raised when span export fails."""
pass
class RateLimitError(TracciaError):
"""Raised when rate limit is exceeded (in strict mode)."""
pass
class InitializationError(TracciaError):
"""Raised when SDK initialization fails."""
pass
class InstrumentationError(TracciaError):
"""Raised when instrumentation/patching fails."""
pass