10.6.4. Exceptions for API Models
Exceptions and warnings for pytan3.api_models
.
-
exception
pytan3.api_models.exceptions.
ModuleError
[source]
Bases: pytan3.exceptions.PyTanError
Parent of all exceptions for pytan3.api_models
.
Thrown from:
-
exception
pytan3.api_models.exceptions.
ModuleWarning
[source]
Bases: pytan3.exceptions.PyTanWarning
Parent of all warnings for pytan3.api_models
.
Thrown from:
-
exception
pytan3.api_models.exceptions.
AttrUndefinedWarning
(obj, attr, value)[source]
Bases: pytan3.api_models.exceptions.ModuleWarning
Warning handler for a simple value being set on an undefined attribute.
- Thrown from:
-
-
__init__
(obj, attr, value)[source]
Constructor.
-
obj
= None
pytan3.api_models.ApiModel
– Object that warning was thrown from.
-
attr
= None
str
– Simple attribute that was adhoc added.
-
value
= None
int
or str
or bool
– Value of attr.
-
error
= None
str
– Warning message that was thrown.
-
exception
pytan3.api_models.exceptions.
AttrUndefinedError
(obj, attr, value)[source]
Bases: pytan3.api_models.exceptions.ModuleError
Exception handler for a complex value being set on an undefined attribute.
- Thrown from:
-
-
__init__
(obj, attr, value)[source]
Constructor.
-
obj
= None
pytan3.api_models.ApiModel
– Object that exception was thrown from.
-
attr
= None
str
– Complex attribute that was supplied.
-
value
= None
dict
or list
– Value of attr.
-
error
= None
str
– Error message that was thrown.
-
exception
pytan3.api_models.exceptions.
AttrTypeError
(obj, attr, value, be_type)[source]
Bases: pytan3.api_models.exceptions.ModuleError
Exception handler for type mismatch of a value being set on a defined attribute.
- Thrown from:
-
-
__init__
(obj, attr, value, be_type)[source]
Constructor.
Parameters: |
- obj (
pytan3.api_models.ApiModel ) – Object that exception was thrown from.
- attr (
str ) – Attribute that had a type mismatch.
- value (
object ) – Value of attr.
- be_type (
object ) – Type that value should be, but is not.
|
-
obj
= None
pytan3.api_models.ApiModel
– Object that exception was thrown from.
-
attr
= None
str
– Attribute that had a type mismatch.
-
value
= None
object
– Value of attr.
-
be_type
= None
object
– Type that value should be, but is not.
-
error
= None
str
– Error message that was thrown.
-
exception
pytan3.api_models.exceptions.
ListTypeError
(obj, attr, value, op)[source]
Bases: pytan3.api_models.exceptions.ModuleError
Exception handler for type mismatch on a list action.
- Thrown from:
-
-
__init__
(obj, attr, value, op)[source]
Constructor.
Parameters: |
- obj (
pytan3.api_models.ApiList ) – Object that exception was thrown from.
- attr (
str ) – Attribute that had a type mismatch.
- value (
object ) – Value of attr.
- op (
str ) – Operation being performed with type mismatch.
|
-
obj
= None
pytan3.api_models.ApiList
– Object that exception was thrown from.
-
attr
= None
str
– Attribute that had a type mismatch.
-
value
= None
object
– Value of attr.
-
op
= None
str
– Operation being performed with type mismatch.
-
error
= None
str
– Error message that was thrown.
-
exception
pytan3.api_models.exceptions.
ListItemTypeError
(obj, item, items, attr, op, be_type)[source]
Bases: pytan3.api_models.exceptions.ModuleError
Exception handler for type mismatch when adding an item to a list.
- Thrown from:
-
-
__init__
(obj, item, items, attr, op, be_type)[source]
Constructor.
Parameters: |
- obj (
pytan3.api_models.ApiList ) – Object that exception was thrown from.
- item (
object ) – Item being added in items that is the wrong type.
- items (
list ) – All items being added to list.
- attr (
str ) – Attribute that had a type mismatch.
- op (
str ) – Operation being performed with type mismatch.
- be_type (
object ) – Type that item should be, but is not.
|
-
obj
= None
pytan3.api_models.ApiList
– Object that exception was thrown from.
-
item
= None
object
– Item being added in items that is the wrong type.
-
items
= None
list
– Full list of items containing item passed to op.
-
attr
= None
str
– Attribute that had a type mismatch.
-
op
= None
str
– Operation being performed with type mismatch.
-
be_type
= None
object
– Type that item should be, but is not.
-
error
= None
str
– Error message that was thrown.
-
exception
pytan3.api_models.exceptions.
GetSingleItemError
(obj, attr, value, regex_value, items)[source]
Bases: pytan3.api_models.exceptions.ModuleError
Exception handler when no items found.
- Thrown from:
-
-
__init__
(obj, attr, value, regex_value, items)[source]
Constructor.
Parameters: |
- obj (
pytan3.api_models.ApiList ) – Object that exception was thrown from.
- attr (
str ) – Attribute to search for value of in items.
- value (
object ) – Value of attr that was being used to match against items.
- regex_value (
bool ) – If regex matching was being used for value.
- items (
list ) – All items in list object.
|
-
obj
= None
pytan3.api_models.ApiList
– Object that exception was thrown from.
-
attr
= None
str
– Attribute used to search for value of in items.
-
value
= None
object
– Value of attr that was being used to match against items.
-
regex_value
= None
bool
– If regex matching was being used for value.
-
items
= None
list
– All items found in list object.
-
error
= None
str
– Error message that was thrown.