Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 02f54c6

Browse filesBrowse files
authored
fix(server): Exit clean on unhandledRejections. (#3092)
Add a handler for unhandledRejections, log error and disconnect all, then exit. Also remove broken, untested rejection handler in middleware. Prior to #3064, this block was probably unreachable; the arguments to serveStaticFile are incorrect.
1 parent 0fdd8f9 commit 02f54c6
Copy full SHA for 02f54c6

File tree

Expand file treeCollapse file tree

2 files changed

+5
-8
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-8
lines changed

‎lib/middleware/karma.js

Copy file name to clipboardExpand all lines: lib/middleware/karma.js
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,6 @@ function createKarmaMiddleware (
236236
.replace('%MAPPINGS%', mappings)
237237
.replace('\n%X_UA_COMPATIBLE%', getXUACompatibleMetaElement(request.url))
238238
})
239-
}, function (errorFiles) {
240-
serveStaticFile(requestUrl, response, function (data) {
241-
common.setNoCacheHeaders(response)
242-
return data.replace('%SCRIPTS%', '').replace('%CLIENT_CONFIG%', '').replace('%MAPPINGS%',
243-
'window.__karma__.error("TEST RUN WAS CANCELLED because ' +
244-
(errorFiles.length > 1 ? 'these files contain' : 'this file contains') +
245-
' some errors:\\n ' + errorFiles.join('\\n ') + '");')
246-
})
247239
})
248240
} else if (requestUrl === '/context.json') {
249241
return filesPromise.then(function (files) {

‎lib/server.js

Copy file name to clipboardExpand all lines: lib/server.js
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,11 @@ class Server extends KarmaEventEmitter {
353353
this.log.error(error)
354354
disconnectBrowsers(1)
355355
})
356+
357+
processWrapper.on('unhandledRejection', (error) => {
358+
this.log.error(error)
359+
disconnectBrowsers(1)
360+
})
356361
}
357362

358363
_detach (config, done) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.