Exit of we fail to connect

This commit is contained in:
Martin Karkowski 2021-07-30 07:49:48 +02:00
parent cb8e890ace
commit efaa3f4d38

View File

@ -2,7 +2,7 @@
* @author Martin Karkowski * @author Martin Karkowski
* @email m.karkowski@zema.de * @email m.karkowski@zema.de
* @create date 2020-03-02 11:37:50 * @create date 2020-03-02 11:37:50
* @modify date 2021-01-04 18:45:37 * @modify date 2021-07-30 07:49:17
* @desc [description] * @desc [description]
*/ */
@ -182,12 +182,10 @@ export class BeckhoffPlc extends BasePlcModule implements IPLCModule {
}); });
} }
} catch (err) { } catch (err) {
this._client.on("error", (err) => {
this._logger.error( this._logger.error(
"Beckhoff Client " + _this.identifier + " got Error", "Beckhoff Client " + _this.identifier + " got Error",
err err
); );
});
} }
}); });
@ -333,6 +331,9 @@ export class BeckhoffPlc extends BasePlcModule implements IPLCModule {
setTimeout(_this._getConfig.apply, 1000, _this, maxRetries - 1); setTimeout(_this._getConfig.apply, 1000, _this, maxRetries - 1);
} else { } else {
this._logger.error("Failed getting the Configuration", err); this._logger.error("Failed getting the Configuration", err);
// Failed to connect to the PLC.
// Exit the System.
process.exit();
} }
}); });
} }