From 0e94815f8d0e3e3fb022594318c75686c3fe11ba Mon Sep 17 00:00:00 2001 From: Scott Walters Date: Fri, 7 Oct 2011 04:02:56 -0400 Subject: [PATCH] FindBind in app.psgi to find the rest of WebGUI and just a touch more diagnostics --- app.psgi | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app.psgi b/app.psgi index fd4e9c506..a5f414a08 100644 --- a/app.psgi +++ b/app.psgi @@ -1,5 +1,10 @@ + use strict; use Plack::Builder; + +use FindBin; +use lib "$FindBin::Bin/lib"; + use WebGUI::Paths -inc; use WebGUI::Config; use WebGUI::Fork; @@ -12,14 +17,15 @@ WebGUI::Fork->init(); builder { my $first_app; + WebGUI::Paths->siteConfigs or die "no configuration files found"; for my $config_file (WebGUI::Paths->siteConfigs) { - my $config = WebGUI::Config->new($config_file); + my $config = WebGUI::Config->new($config_file) or die "failed to log configuration file: $config_file: $!"; my $psgi = $config->get('psgiFile') || WebGUI::Paths->defaultPSGI; my $app = do { # default psgi file uses environment variable to find config file local $ENV{WEBGUI_CONFIG} = $config_file; Plack::Util::load_psgi($psgi); - }; + } or die; $first_app ||= $app; my $gateway = $config->get('gateway'); $gateway =~ s{^/?}{/};