mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 15:39:11 +00:00
detect EADDRINUSE on server start (#1348)
* detect `EADDRINUSE` on server start * @ts-expect-error * send portError to electron * use escalateErrorFn * dont move in docker * allow errors to be sendt to electron UI * Log after the new port is found * Update comment Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com> * update comment Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com> * update comment Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com> * rename to escalate * extract `serverTryDesiredPort` * type check server.address() * request shutdown on `unrecoverable` `escalateError` * combine network utils * reject promise * not unrecoverable by default * unneeded assignment --------- Co-authored-by: Carlos Valente <34649812+cpvalente@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1af394cd49
commit
29243e3f6c
@@ -23,7 +23,7 @@ if (!isProduction) {
|
||||
}
|
||||
|
||||
/** Flag holds server loading state */
|
||||
let loaded = 'Ontime running';
|
||||
let loaded = 'Ontime starting';
|
||||
|
||||
/**
|
||||
* Flag whether user has requested a quit
|
||||
@@ -109,8 +109,13 @@ function askToQuit() {
|
||||
* Allows processes to escalate errors to be shown in electron
|
||||
* @param {string} error
|
||||
*/
|
||||
function escalateError(error) {
|
||||
dialog.showErrorBox('An unrecoverable error occurred', error);
|
||||
function escalateError(error, unrecoverable = false) {
|
||||
if (unrecoverable) {
|
||||
dialog.showErrorBox('An unrecoverable error occurred', error);
|
||||
appShutdown();
|
||||
} else {
|
||||
dialog.showErrorBox('An error occurred', error);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user