mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-06 00:10:25 +00:00
Bug 681840 - Print helpful warning when starting test HTTP server fails. r=philikon DONTBUILD
This commit is contained in:
parent
c2d667b7f6
commit
cb8ed04e8d
@ -7,10 +7,21 @@ function new_timestamp() {
|
||||
|
||||
function httpd_setup (handlers) {
|
||||
let server = new nsHttpServer();
|
||||
let port = 8080;
|
||||
for (let path in handlers) {
|
||||
server.registerPathHandler(path, handlers[path]);
|
||||
}
|
||||
server.start(8080);
|
||||
try {
|
||||
server.start(port);
|
||||
} catch (ex) {
|
||||
_("==========================================");
|
||||
_("Got exception starting HTTP server on port " + port);
|
||||
_("Error: " + Utils.exceptionStr(ex));
|
||||
_("Is there a process already listening on port " + port + "?");
|
||||
_("==========================================");
|
||||
do_throw(ex);
|
||||
}
|
||||
|
||||
return server;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user