|
| 1 | +<!-- markdownlint-disable --> |
| 2 | + |
| 3 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L0"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 4 | + |
| 5 | +# <kbd>module</kbd> `foundry.errors` |
| 6 | +Structured error classes for Foundry. |
| 7 | + |
| 8 | +These errors provide: 1. Error codes for programmatic handling 2. Human-readable messages 3. Recovery hints for agents and users 4. Structured details for debugging |
| 9 | + |
| 10 | +This enables both humans and AI agents to understand and recover from errors. |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | +--- |
| 15 | + |
| 16 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L16"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 17 | + |
| 18 | +## <kbd>class</kbd> `FoundryError` |
| 19 | +Base error class with structured information for agents and users. |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +**Attributes:** |
| 24 | + |
| 25 | + - <b>`code`</b>: Machine-readable error code (e.g., "DATASET_NOT_FOUND") |
| 26 | + - <b>`message`</b>: Human-readable error description |
| 27 | + - <b>`details`</b>: Additional context for debugging |
| 28 | + - <b>`recovery_hint`</b>: Actionable suggestion for resolving the error |
| 29 | + |
| 30 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/<string>"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 31 | + |
| 32 | +### <kbd>method</kbd> `__init__` |
| 33 | + |
| 34 | +```python |
| 35 | +__init__( |
| 36 | + code: str, |
| 37 | + message: str, |
| 38 | + details: Optional[Dict[str, Any]] = None, |
| 39 | + recovery_hint: Optional[str] = None |
| 40 | +) → None |
| 41 | +``` |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +--- |
| 51 | + |
| 52 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 53 | + |
| 54 | +### <kbd>method</kbd> `to_dict` |
| 55 | + |
| 56 | +```python |
| 57 | +to_dict() → Dict[str, Any] |
| 58 | +``` |
| 59 | + |
| 60 | +Serialize error to dictionary for JSON responses. |
| 61 | + |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L51"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 66 | + |
| 67 | +## <kbd>class</kbd> `DatasetNotFoundError` |
| 68 | +Raised when a dataset cannot be found. |
| 69 | + |
| 70 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L54"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 71 | + |
| 72 | +### <kbd>method</kbd> `__init__` |
| 73 | + |
| 74 | +```python |
| 75 | +__init__(query: str, search_type: str = 'query') |
| 76 | +``` |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | +--- |
| 86 | + |
| 87 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 88 | + |
| 89 | +### <kbd>method</kbd> `to_dict` |
| 90 | + |
| 91 | +```python |
| 92 | +to_dict() → Dict[str, Any] |
| 93 | +``` |
| 94 | + |
| 95 | +Serialize error to dictionary for JSON responses. |
| 96 | + |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L66"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 101 | + |
| 102 | +## <kbd>class</kbd> `AuthenticationError` |
| 103 | +Raised when authentication fails. |
| 104 | + |
| 105 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L69"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 106 | + |
| 107 | +### <kbd>method</kbd> `__init__` |
| 108 | + |
| 109 | +```python |
| 110 | +__init__(service: str, reason: str = None) |
| 111 | +``` |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | +--- |
| 121 | + |
| 122 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 123 | + |
| 124 | +### <kbd>method</kbd> `to_dict` |
| 125 | + |
| 126 | +```python |
| 127 | +to_dict() → Dict[str, Any] |
| 128 | +``` |
| 129 | + |
| 130 | +Serialize error to dictionary for JSON responses. |
| 131 | + |
| 132 | + |
| 133 | +--- |
| 134 | + |
| 135 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L84"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 136 | + |
| 137 | +## <kbd>class</kbd> `DownloadError` |
| 138 | +Raised when a file download fails. |
| 139 | + |
| 140 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L87"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 141 | + |
| 142 | +### <kbd>method</kbd> `__init__` |
| 143 | + |
| 144 | +```python |
| 145 | +__init__(url: str, reason: str, destination: str = None) |
| 146 | +``` |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | +--- |
| 156 | + |
| 157 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 158 | + |
| 159 | +### <kbd>method</kbd> `to_dict` |
| 160 | + |
| 161 | +```python |
| 162 | +to_dict() → Dict[str, Any] |
| 163 | +``` |
| 164 | + |
| 165 | +Serialize error to dictionary for JSON responses. |
| 166 | + |
| 167 | + |
| 168 | +--- |
| 169 | + |
| 170 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L99"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 171 | + |
| 172 | +## <kbd>class</kbd> `DataLoadError` |
| 173 | +Raised when loading data from a file fails. |
| 174 | + |
| 175 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L102"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 176 | + |
| 177 | +### <kbd>method</kbd> `__init__` |
| 178 | + |
| 179 | +```python |
| 180 | +__init__(file_path: str, reason: str, data_type: str = None) |
| 181 | +``` |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | +--- |
| 191 | + |
| 192 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 193 | + |
| 194 | +### <kbd>method</kbd> `to_dict` |
| 195 | + |
| 196 | +```python |
| 197 | +to_dict() → Dict[str, Any] |
| 198 | +``` |
| 199 | + |
| 200 | +Serialize error to dictionary for JSON responses. |
| 201 | + |
| 202 | + |
| 203 | +--- |
| 204 | + |
| 205 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L114"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 206 | + |
| 207 | +## <kbd>class</kbd> `ValidationError` |
| 208 | +Raised when metadata validation fails. |
| 209 | + |
| 210 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L117"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 211 | + |
| 212 | +### <kbd>method</kbd> `__init__` |
| 213 | + |
| 214 | +```python |
| 215 | +__init__(field_name: str, error_msg: str, schema_type: str = 'metadata') |
| 216 | +``` |
| 217 | + |
| 218 | + |
| 219 | + |
| 220 | + |
| 221 | + |
| 222 | + |
| 223 | + |
| 224 | + |
| 225 | +--- |
| 226 | + |
| 227 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 228 | + |
| 229 | +### <kbd>method</kbd> `to_dict` |
| 230 | + |
| 231 | +```python |
| 232 | +to_dict() → Dict[str, Any] |
| 233 | +``` |
| 234 | + |
| 235 | +Serialize error to dictionary for JSON responses. |
| 236 | + |
| 237 | + |
| 238 | +--- |
| 239 | + |
| 240 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L129"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 241 | + |
| 242 | +## <kbd>class</kbd> `PublishError` |
| 243 | +Raised when publishing a dataset fails. |
| 244 | + |
| 245 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L132"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 246 | + |
| 247 | +### <kbd>method</kbd> `__init__` |
| 248 | + |
| 249 | +```python |
| 250 | +__init__(reason: str, source_id: str = None, status: str = None) |
| 251 | +``` |
| 252 | + |
| 253 | + |
| 254 | + |
| 255 | + |
| 256 | + |
| 257 | + |
| 258 | + |
| 259 | + |
| 260 | +--- |
| 261 | + |
| 262 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 263 | + |
| 264 | +### <kbd>method</kbd> `to_dict` |
| 265 | + |
| 266 | +```python |
| 267 | +to_dict() → Dict[str, Any] |
| 268 | +``` |
| 269 | + |
| 270 | +Serialize error to dictionary for JSON responses. |
| 271 | + |
| 272 | + |
| 273 | +--- |
| 274 | + |
| 275 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L144"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 276 | + |
| 277 | +## <kbd>class</kbd> `CacheError` |
| 278 | +Raised when cache operations fail. |
| 279 | + |
| 280 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L147"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 281 | + |
| 282 | +### <kbd>method</kbd> `__init__` |
| 283 | + |
| 284 | +```python |
| 285 | +__init__(operation: str, reason: str, cache_path: str = None) |
| 286 | +``` |
| 287 | + |
| 288 | + |
| 289 | + |
| 290 | + |
| 291 | + |
| 292 | + |
| 293 | + |
| 294 | + |
| 295 | +--- |
| 296 | + |
| 297 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 298 | + |
| 299 | +### <kbd>method</kbd> `to_dict` |
| 300 | + |
| 301 | +```python |
| 302 | +to_dict() → Dict[str, Any] |
| 303 | +``` |
| 304 | + |
| 305 | +Serialize error to dictionary for JSON responses. |
| 306 | + |
| 307 | + |
| 308 | +--- |
| 309 | + |
| 310 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L159"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 311 | + |
| 312 | +## <kbd>class</kbd> `ConfigurationError` |
| 313 | +Raised when Foundry is misconfigured. |
| 314 | + |
| 315 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L162"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 316 | + |
| 317 | +### <kbd>method</kbd> `__init__` |
| 318 | + |
| 319 | +```python |
| 320 | +__init__(setting: str, reason: str, current_value: Any = None) |
| 321 | +``` |
| 322 | + |
| 323 | + |
| 324 | + |
| 325 | + |
| 326 | + |
| 327 | + |
| 328 | + |
| 329 | + |
| 330 | +--- |
| 331 | + |
| 332 | +<a href="https://github.com/MLMI2-CSSI/foundry/tree/main/foundry/errors.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a> |
| 333 | + |
| 334 | +### <kbd>method</kbd> `to_dict` |
| 335 | + |
| 336 | +```python |
| 337 | +to_dict() → Dict[str, Any] |
| 338 | +``` |
| 339 | + |
| 340 | +Serialize error to dictionary for JSON responses. |
| 341 | + |
| 342 | + |
| 343 | + |
| 344 | + |
| 345 | +--- |
| 346 | + |
| 347 | +_This file was automatically generated via [lazydocs](https://github.com/ml-tooling/lazydocs)._ |
0 commit comments