-
Notifications
You must be signed in to change notification settings - Fork 97
Exceptions like client.close/subscription.close cannot be catched #429
Open
Description
Not sure what would be better here, that either the exception should be catchable or it should be idempotent.
const Pulsar = require("pulsar-client"); const STAGING = { serviceUrl: "pulsar+ssl://any-server:6651", }; async function main() { const client = new Pulsar.Client({ ...STAGING, logLevel: Pulsar.LogLevel.ERROR, log: (level, file, line, message) => { console.log(`[${level}] ${file}:${line}: ${message}`); }, }); try { await client.close(); await client.close(); } catch (error) { console.error("omg closing client:", error); } } main();
{
"dependencies": {
"pulsar-client": "^1.14.0"
}
}
Will throw
node error-report.js
node:internal/process/promises:391
triggerUncaughtException(err, true /* fromPromise */);
^
[Error: Failed to close client: AlreadyClosed]
Node.js v20.18.1
Even though I catched it
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.