-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
The StreamManagerClient constructor implicitly calls the asynchronous method _connect() to the stream manager service. If the connection fails, the promise is rejected, and must be caught via an unhandledRejection callback (https://nodejs.org/api/process.html#process_event_unhandledrejection).
This information should be added to the documentation of the StreamManagerClient.
aws-greengrass-core-sdk-js/aws-greengrass-core-sdk/stream-manager/client.js
Lines 38 to 44 in 0dcbd0b
| * @example <caption>StreamManager Usage</caption> | |
| * const { StreamManagerClient } = require('aws-greengrass-core-sdk/stream-manager'); | |
| * const client = new StreamManagerClient(); | |
| * c.onConnected(async () => { | |
| * // Do work with the client (c) here. | |
| * }); | |
| */ |
const client = new StreamManagerClient();
process.on('unhandledRejection', (reason, promise) => {
console.log('Unhandled Rejection at:', promise, 'reason:', reason);
// Application specific logging, throwing an error, or other logic here
});
client.on('connected', () => {
}
);
Metadata
Metadata
Assignees
Labels
No labels