(optdeps) _gen_pod can *very much* fail, not sure what I was thinking
Peter Rabbitson [Sun, 6 Mar 2016 06:08:56 +0000 (07:08 +0100)]
maint/Makefile.PL.inc/53_autogen_pod.pl

index f595f0d..1c5530f 100644 (file)
@@ -22,10 +22,17 @@ else {
 {
   print "Regenerating Optional/Dependencies.pod\n";
 
-  # this should always succeed - hence no error checking
-  # if someone breaks OptDeps - travis should catch it
-  require DBIx::Class::Optional::Dependencies;
-  DBIx::Class::Optional::Dependencies->_gen_pod ($ver, "$pod_dir/lib");
+  eval {
+    require DBIx::Class::Optional::Dependencies;
+    DBIx::Class::Optional::Dependencies->_gen_pod ($ver, "$pod_dir/lib");
+    1;
+  }
+    or
+  printf ("FAILED!!! Subsequent `make dist` will fail. %s\n",
+    $ENV{DBICDIST_DEBUG}
+      ? "Full error: $@"
+      : 'Re-run with $ENV{DBICDIST_DEBUG} set for more info'
+  );
 
   postamble <<"EOP";