mirror of
https://github.com/coder/code-server.git
synced 2026-05-05 03:55:18 +02:00
refactor: remove dead code (#5188)
* refactor: delete unused code
* refactor: move onLine to test helpers
* Revert "refactor: move onLine to test helpers"
This reverts commit 32cc27b213.
* fixup! refactor: delete unused code
This commit is contained in:
@@ -102,29 +102,6 @@ export const ensureAddress = (server: http.Server, protocol: string): URL | stri
|
||||
return addr
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles error events from the server.
|
||||
*
|
||||
* If the outlying Promise didn't resolve
|
||||
* then we reject with the error.
|
||||
*
|
||||
* Otherwise, we log the error.
|
||||
*
|
||||
* We extracted into a function so that we could
|
||||
* test this logic more easily.
|
||||
*/
|
||||
export const handleServerError = (resolved: boolean, err: Error, reject: (err: Error) => void) => {
|
||||
// Promise didn't resolve earlier so this means it's an error
|
||||
// that occurs before the server can successfully listen.
|
||||
// Possibly triggered by listening on an invalid port or socket.
|
||||
if (!resolved) {
|
||||
reject(err)
|
||||
} else {
|
||||
// Promise resolved earlier so this is an unrelated error.
|
||||
util.logError(logger, "http server error", err)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the error that occurs in the catch block
|
||||
* after we try fs.unlink(args.socket).
|
||||
|
||||
Reference in New Issue
Block a user