Skip to content

Commit fd007b8

Browse files
authored
Minor updates to code samples
1 parent 772e562 commit fd007b8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

articles/cosmos-db/table/how-to-use-nodejs.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ communicate with the Storage REST services.
5151
Add the following code to the top of the **server.js** file in your application:
5252

5353
```javascript
54-
const { TableServiceClient } = require("@azure/data-tables");
54+
const { TableServiceClient, odata } = require("@azure/data-tables");
5555
```
5656

5757
## Connect to Azure Table service
@@ -186,8 +186,11 @@ For successful batch operations, `result` contains information for each operatio
186186
To return a specific entity based on the **PartitionKey** and **RowKey**, use the **getEntity** method.
187187

188188
```javascript
189-
let result = await tableClient.getEntity("hometasks", "1");
190-
// result contains the entity
189+
let result = await tableClient.getEntity("hometasks", "1")
190+
.catch((error) => {
191+
// handle any errors
192+
});
193+
// result contains the entity
191194
```
192195

193196
After this operation is complete, `result` contains the entity.

0 commit comments

Comments
 (0)