Skip to content

Commit

Permalink
fix OPCUAClient#emit('connection_failed',...)
Browse files Browse the repository at this point in the history
  • Loading branch information
erossignon committed Jun 10, 2023
1 parent 6c366ba commit bd5dc55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/node-opcua-client/source/private/client_base_impl.ts
Expand Up @@ -753,7 +753,7 @@ export class ClientBaseImpl extends OPCUASecureObject implements OPCUAClientBase
if (!fs.existsSync(this.certificateFile)) {
await withLock({ fileToLock: this.certificateFile + ".mutex" }, async () => {
if (fs.existsSync(this.certificateFile)) {
// the file may have been created in between
// the file may have been created in between
return;
}
console.log("Creating default certificate ... please wait");
Expand Down Expand Up @@ -810,13 +810,13 @@ export class ClientBaseImpl extends OPCUASecureObject implements OPCUAClientBase

protected _handleUnrecoverableConnectionFailure(err: Error, callback: ErrorCallback): void {
debugLog(err.message);
this.emit("connection_failed");
this.emit("connection_failed", err);
this._setInternalState("disconnected");
return callback(err);
}
private _handleDisconnectionWhileConnecting(err: Error, callback: ErrorCallback) {
debugLog(err.message);
this.emit("connection_failed");
this.emit("connection_failed", err);
this._setInternalState("disconnected");
return callback(err);
}
Expand Down

0 comments on commit bd5dc55

Please sign in to comment.