Mercurial Hosting > luan
diff src/luan/host/WebHandler.java @ 1335:e0cf0d108a77
major cleanup
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 14 Feb 2019 03:10:45 -0700 |
parents | 25746915a241 |
children | 7483108154bb |
line wrap: on
line diff
--- a/src/luan/host/WebHandler.java Tue Feb 12 22:53:57 2019 -0700 +++ b/src/luan/host/WebHandler.java Thu Feb 14 03:10:45 2019 -0700 @@ -12,6 +12,7 @@ import luan.LuanTable; import luan.LuanFunction; import luan.LuanClosure; +import luan.LuanRuntimeException; import luan.modules.BasicLuan; import luan.modules.http.LuanHandler; import luan.modules.logging.Log4j; @@ -20,14 +21,6 @@ public class WebHandler implements Handler { private static final Logger logger = LoggerFactory.getLogger(WebHandler.class); - private static final class LuanRuntimeException extends RuntimeException { - final LuanException e; - - LuanRuntimeException(LuanException e) { - this.e = e; - } - } - private static final DomainHandler.Factory factory = new DomainHandler.Factory() { public Handler newHandler(String domain) { File dir = new File(sitesDir,domain); @@ -103,7 +96,7 @@ security(luan,dir); try { LuanFunction fn = BasicLuan.load_file(luan,"classpath:luan/host/init.luan"); - fn.call(luan,new Object[]{dir,domain,logging}); + fn.call(dir,domain,logging); } catch(LuanException e) { throw new LuanRuntimeException(e); } @@ -117,7 +110,7 @@ try { domainHandler.getHandler(domain); } catch(LuanRuntimeException e) { - throw e.e; + throw (LuanException)e.getCause(); } }