Skip to content

Commit 0e94815

Browse files
committedOct 7, 2011
FindBind in app.psgi to find the rest of WebGUI and just a touch more diagnostics
1 parent 51f4102 commit 0e94815

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎app.psgi

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
12
use strict;
23
use Plack::Builder;
4+
5+
use FindBin;
6+
use lib "$FindBin::Bin/lib";
7+
38
use WebGUI::Paths -inc;
49
use WebGUI::Config;
510
use WebGUI::Fork;
@@ -12,14 +17,15 @@ WebGUI::Fork->init();
1217

1318
builder {
1419
my $first_app;
20+
WebGUI::Paths->siteConfigs or die "no configuration files found";
1521
for my $config_file (WebGUI::Paths->siteConfigs) {
16-
my $config = WebGUI::Config->new($config_file);
22+
my $config = WebGUI::Config->new($config_file) or die "failed to log configuration file: $config_file: $!";
1723
my $psgi = $config->get('psgiFile') || WebGUI::Paths->defaultPSGI;
1824
my $app = do {
1925
# default psgi file uses environment variable to find config file
2026
local $ENV{WEBGUI_CONFIG} = $config_file;
2127
Plack::Util::load_psgi($psgi);
22-
};
28+
} or die;
2329
$first_app ||= $app;
2430
my $gateway = $config->get('gateway');
2531
$gateway =~ s{^/?}{/};

0 commit comments

Comments
 (0)
Please sign in to comment.