@@ -3,13 +3,15 @@ sidebar_label: types
33title : aixplain.exceptions.types
44---
55
6+ Exception types and error handling for the aiXplain SDK.
7+
68### ErrorSeverity Objects
79
810``` python
911class ErrorSeverity (str , Enum )
1012```
1113
12- [[view_source ]](https :// github .com / aixplain / aiXplain / blob / main / aixplain / exceptions / types .py # L5 )
14+ [[view_source ]](https :// github .com / aixplain / aiXplain / blob / main / aixplain / exceptions / types .py # L7 )
1315
1416Enumeration of error severity levels in the aiXplain system .
1517
@@ -45,7 +47,7 @@ System stability might be compromised
4547class ErrorCategory (Enum)
4648```
4749
48- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L24 )
50+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L26 )
4951
5052Enumeration of error categories in the aiXplain system.
5153
@@ -111,7 +113,7 @@ Uncategorized errors
111113class ErrorCode(str , Enum)
112114```
113115
114- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L55 )
116+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L57 )
115117
116118Standard error codes for aiXplain exceptions.
117119
@@ -173,7 +175,7 @@ General internal error. Use for unexpected server-side errors that are not cover
173175def __str__ () -> str
174176```
175177
176- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L88 )
178+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L90 )
177179
178180Return the string representation of the error code.
179181
@@ -187,7 +189,7 @@ Return the string representation of the error code.
187189class AixplainBaseException(Exception )
188190```
189191
190- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L97 )
192+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L99 )
191193
192194Base exception class for all aiXplain exceptions.
193195
@@ -205,13 +207,39 @@ severity, and additional context.
205207- `retry_recommended` _bool_ - Whether retrying the operation might succeed.
206208- `error_code` _Optional[ErrorCode]_ - Standardized error code.
207209
210+ # ### \_\_init\_\_
211+
212+ ```python
213+ def __init__ (message: str ,
214+ category: ErrorCategory = ErrorCategory.UNKNOWN ,
215+ severity: ErrorSeverity = ErrorSeverity.ERROR ,
216+ status_code: Optional[int ] = None ,
217+ details: Optional[Dict[str , Any]] = None ,
218+ retry_recommended: bool = False ,
219+ error_code: Optional[ErrorCode] = None )
220+ ```
221+
222+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L116)
223+
224+ Initialize the base exception with structured error information.
225+
226+ ** Arguments** :
227+
228+ - `message` - Error message describing the issue.
229+ - `category` - Category of the error (default: UNKNOWN ).
230+ - `severity` - Severity level of the error (default: ERROR ).
231+ - `status_code` - HTTP status code if applicable.
232+ - `details` - Additional error context and details.
233+ - `retry_recommended` - Whether retrying the operation might succeed.
234+ - `error_code` - Standardized error code for the exception.
235+
208236# ### \_\_str\_\_
209237
210238```python
211239def __str__ () -> str
212240```
213241
214- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L133 )
242+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L146 )
215243
216244Return a string representation of the exception.
217245
@@ -226,7 +254,7 @@ Return a string representation of the exception.
226254def to_dict() -> Dict[str , Any]
227255```
228256
229- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L143 )
257+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L156 )
230258
231259Convert the exception to a dictionary for serialization.
232260
@@ -242,77 +270,232 @@ Convert the exception to a dictionary for serialization.
242270class AuthenticationError(AixplainBaseException)
243271```
244272
245- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L162 )
273+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L175 )
246274
247275Raised when authentication fails.
248276
277+ # ### \_\_init\_\_
278+
279+ ```python
280+ def __init__ (message: str , ** kwargs)
281+ ```
282+
283+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L178)
284+
285+ Initialize authentication error.
286+
287+ ** Arguments** :
288+
289+ - `message` - Error message describing the authentication issue.
290+ - `** kwargs` - Additional keyword arguments passed to parent class .
291+
249292# ## ValidationError Objects
250293
251294```python
252295class ValidationError(AixplainBaseException)
253296```
254297
255- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L176 )
298+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L195 )
256299
257300Raised when input validation fails.
258301
302+ # ### \_\_init\_\_
303+
304+ ```python
305+ def __init__ (message: str , ** kwargs)
306+ ```
307+
308+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L198)
309+
310+ Initialize validation error.
311+
312+ ** Arguments** :
313+
314+ - `message` - Error message describing the validation issue.
315+ - `** kwargs` - Additional keyword arguments passed to parent class .
316+
317+ # ## AlreadyDeployedError Objects
318+
319+ ```python
320+ class AlreadyDeployedError(AixplainBaseException)
321+ ```
322+
323+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L215)
324+
325+ Raised when attempting to deploy an asset that is already deployed.
326+
327+ # ### \_\_init\_\_
328+
329+ ```python
330+ def __init__ (message: str , ** kwargs)
331+ ```
332+
333+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L218)
334+
335+ Initialize already deployed error.
336+
337+ ** Arguments** :
338+
339+ - `message` - Error message describing the deployment state conflict.
340+ - `** kwargs` - Additional keyword arguments passed to parent class .
341+
259342# ## ResourceError Objects
260343
261344```python
262345class ResourceError(AixplainBaseException)
263346```
264347
265- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L190 )
348+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L233 )
266349
267350Raised when a resource is unavailable.
268351
352+ # ### \_\_init\_\_
353+
354+ ```python
355+ def __init__ (message: str , ** kwargs)
356+ ```
357+
358+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L236)
359+
360+ Initialize resource error.
361+
362+ ** Arguments** :
363+
364+ - `message` - Error message describing the resource issue.
365+ - `** kwargs` - Additional keyword arguments passed to parent class .
366+
269367# ## BillingError Objects
270368
271369```python
272370class BillingError(AixplainBaseException)
273371```
274372
275- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L204 )
373+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L253 )
276374
277375Raised when there are billing issues.
278376
377+ # ### \_\_init\_\_
378+
379+ ```python
380+ def __init__ (message: str , ** kwargs)
381+ ```
382+
383+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L256)
384+
385+ Initialize billing error.
386+
387+ ** Arguments** :
388+
389+ - `message` - Error message describing the billing issue.
390+ - `** kwargs` - Additional keyword arguments passed to parent class .
391+
279392# ## SupplierError Objects
280393
281394```python
282395class SupplierError(AixplainBaseException)
283396```
284397
285- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L218 )
398+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L273 )
286399
287400Raised when there are issues with external suppliers.
288401
402+ # ### \_\_init\_\_
403+
404+ ```python
405+ def __init__ (message: str , ** kwargs)
406+ ```
407+
408+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L276)
409+
410+ Initialize supplier error.
411+
412+ ** Arguments** :
413+
414+ - `message` - Error message describing the supplier issue.
415+ - `** kwargs` - Additional keyword arguments passed to parent class .
416+
289417# ## NetworkError Objects
290418
291419```python
292420class NetworkError(AixplainBaseException)
293421```
294422
295- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L232 )
423+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L293 )
296424
297425Raised when there are network connectivity issues.
298426
427+ # ### \_\_init\_\_
428+
429+ ```python
430+ def __init__ (message: str , ** kwargs)
431+ ```
432+
433+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L296)
434+
435+ Initialize network error.
436+
437+ ** Arguments** :
438+
439+ - `message` - Error message describing the network issue.
440+ - `** kwargs` - Additional keyword arguments passed to parent class .
441+
299442# ## ServiceError Objects
300443
301444```python
302445class ServiceError(AixplainBaseException)
303446```
304447
305- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L246 )
448+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L313 )
306449
307450Raised when a service is unavailable.
308451
452+ # ### \_\_init\_\_
453+
454+ ```python
455+ def __init__ (message: str , ** kwargs)
456+ ```
457+
458+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L316)
459+
460+ Initialize service error.
461+
462+ ** Arguments** :
463+
464+ - `message` - Error message describing the service issue.
465+ - `** kwargs` - Additional keyword arguments passed to parent class .
466+
309467# ## InternalError Objects
310468
311469```python
312470class InternalError(AixplainBaseException)
313471```
314472
315- [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L260 )
473+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L333 )
316474
317475Raised when there is an internal system error.
318476
477+ # ### \_\_init\_\_
478+
479+ ```python
480+ def __init__ (message: str , ** kwargs)
481+ ```
482+
483+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L336)
484+
485+ Initialize internal error.
486+
487+ ** Arguments** :
488+
489+ - `message` - Error message describing the internal issue.
490+ - `** kwargs` - Additional keyword arguments passed to parent class .
491+
492+ # ## AlreadyDeployedError Objects
493+
494+ ```python
495+ class AlreadyDeployedError(AixplainBaseException)
496+ ```
497+
498+ [[view_source]](https:// github.com/ aixplain/ aiXplain/ blob/ main/ aixplain/ exceptions/ types.py# L359)
499+
500+ Raised when an asset is already deployed.
501+
0 commit comments