I'm new to Python error handling.
Using Azure Table Storage as a config table for a Python Azure Function. To lookup a specific row in the table, I'm using the table_service constructor.
from azure.cosmosdb.table.tableservice import TableService
from azure.cosmosdb.table.models import Entity
TableName = "Table1"
PartitionKey = 'test'
RowKey = '123'
table_service.get_entity(TableName, PartitionKey, RowKey)
If an entity (row) is not found, the result is:
Client-Request-ID = 123-xzy
Receiving Response: Server
Timestamp = Thu, 19 Nov 2020 20: 43: 23 GMT,
Server-Request-ID = xyz-123,
HTTP Status Code = 404,
Message = Not Found,
Headers = {
'cache-control': 'no-cache',
'transfer-encoding': 'chunked',
'content-type': 'application/json;odata=minimalmetadata;streaming=true;charset=utf-8',
'server': 'Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0',
'x-ms-request-id': 'xxx-xxx',
'x-ms-version': '2018-03-28',
'x-content-type-options': 'nosniff',
'date': 'Thu, 19 Nov 2020 20:43:23 GMT'
}
How do I use Python to access the Not Found
message in the response?