about summary refs log tree commit homepage
path: root/script/public-inbox-init
diff options
authorEric Wong <e@80x24.org>2019-05-15 01:18:09 +0000
committerEric Wong <e@80x24.org>2019-05-15 06:15:34 +0000
commitd0e8bfd866ed1e924e8d9f551939eecbea4920ef (patch)
treef8d4ba5e37452e42d9851e793d5132484907e123 /script/public-inbox-init
parentb5c64fc01d3e7ca6243fdd8b811b6291bdb12235 (diff)
Since we lazy-load Xapian now, some errors may become
more cryptic or buried.  Try to improve that by making
Admin show better errors.
Diffstat (limited to 'script/public-inbox-init')
1 files changed, 5 insertions, 2 deletions
diff --git a/script/public-inbox-init b/script/public-inbox-init
index 9f0bd1bd..5516e798 100755
--- a/script/public-inbox-init
+++ b/script/public-inbox-init
@@ -7,8 +7,10 @@ use strict;
 use warnings;
 my $usage = "public-inbox-init NAME REPO_DIR HTTP_URL ADDRESS [ADDRESS..]";
 use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/;
-use PublicInbox::Config;
-use PublicInbox::Inbox;
+use PublicInbox::Admin;
+require PublicInbox::Config;
+require PublicInbox::Inbox;
 use File::Temp qw/tempfile/;
 use File::Basename qw/dirname/;
 use File::Path qw/mkpath/;
@@ -24,6 +26,7 @@ my %opts = ( 'V|version=i' => \$version,
              'S|skip=i' => \$skip,
 GetOptions(%opts) or usage();
+PublicInbox::Admin::indexlevel_ok_or_die($indexlevel) if defined $indexlevel;
 my $name = shift @ARGV or usage();
 my $mainrepo = shift @ARGV or usage();
 my $http_url = shift @ARGV or usage();