Skip to content

Commit

Permalink
1.5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollon77 committed Apr 30, 2020
1 parent 3cf6e0a commit e90782c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ BotFather: Success! The new status is: DISABLED. /help
```

## Changelog
### 1.5.7 (2020-04-30)
### 1.5.8 (2020-04-30)
* (Apollon77) errors on webserver initialization are handled properly

### 1.5.6 (2020-04-04)
Expand Down
4 changes: 2 additions & 2 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"require": {
"js-controller": ">2.0.0"
},
"version": "1.5.7",
"version": "1.5.8",
"news": {
"1.5.7": {
"1.5.8": {
"en": "errors on webserver initialization are handled properly",
"de": "Fehler bei der Webserver-Initialisierung werden ordnungsgemäß behandelt",
"ru": "ошибки при инициализации веб-сервера обрабатываются правильно",
Expand Down
9 changes: 6 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,15 @@ function startAdapter(options) {
server.server.__server = server;

let serverListening = false;
let serverPort = adapter.config.port;
server.server.on('error', e => {
if (e.toString().includes('EACCES') && port <= 1024) {
adapter.log.error(`node.js process has no rights to start server on the port ${port}.\n` +
if (e.toString().includes('EACCES') && serverPort <= 1024) {
adapter.log.error(`node.js process has no rights to start server on the port ${serverPort}.\n` +
`Do you know that on linux you need special permissions for ports under 1024?\n` +
`You can call in shell following scrip to allow it for node.js: "iobroker fix"`
);
} else {
adapter.log.error(`Cannot start server on ${settings.bind || '0.0.0.0'}:${port}: ${e}`);
adapter.log.error(`Cannot start server on ${settings.bind || '0.0.0.0'}:${serverPort}: ${e}`);
}
if (!serverListening) {
adapter.terminate ? adapter.terminate(1) : process.exit(1);
Expand All @@ -178,6 +179,8 @@ function startAdapter(options) {
adapter.log.error('port ' + adapter.config.port + ' already in use');
adapter.terminate ? adapter.terminate() : process.exit(1);
}
serverPort = port;

server.server.listen(port, (!adapter.config.bind || adapter.config.bind === '0.0.0.0') ? undefined : adapter.config.bind || undefined, () => {
serverListening = true;
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "iobroker.telegram",
"description": "The adapter allows to send and receive telegram messages from ioBroker and to be a broker.",
"version": "1.5.7",
"version": "1.5.8",
"author": "bluefox <[email protected]>",
"homepage": "https://github.com/iobroker-community-adapters/ioBroker.telegram",
"repository": {
Expand Down

0 comments on commit e90782c

Please sign in to comment.