diff --git a/utils/pas2js/compileserver.lpi b/utils/pas2js/compileserver.lpi index fe3a3fd715..f9a018056c 100644 --- a/utils/pas2js/compileserver.lpi +++ b/utils/pas2js/compileserver.lpi @@ -1,15 +1,15 @@ - + + - <UseAppBundle Value="False"/> <ResourceType Value="res"/> diff --git a/utils/pas2js/httpcompiler.pp b/utils/pas2js/httpcompiler.pp index cd934a67e2..e0727e9d99 100644 --- a/utils/pas2js/httpcompiler.pp +++ b/utils/pas2js/httpcompiler.pp @@ -9,11 +9,13 @@ uses {$ifdef unix}baseunix,{$endif} sysutils, classes, fpjson, contnrs, syncobjs, fpmimetypes, custhttpapp, inifiles, fpwebproxy, webutil, fpwebfile, httproute, httpdefs, dirwatch, Pas2JSFSCompiler, - Pas2JSCompilerCfg; + Pas2JSCompilerCfg, ssockets; Const nErrTooManyThreads = -1; + nExitCodeSocketError = 1; + Type TDirWatcher = Class; THTTPCompilerApplication = Class; @@ -813,7 +815,15 @@ begin TSimpleFileModule.RegisterDefaultRoute; if InterfaceAddress<>'' then HTTPHandler.Address:=InterfaceAddress; - inherited; + try + inherited DoRun; + except + on E: ESocketError do begin + Log(etError,E.ClassName+': '+E.Message); + ExitCode:=nExitCodeSocketError; + Terminate; + end; + end; end; end.