[904] in BarnOwl Developers
[D-O-H] r891 - branches/barnowl_sqlite/owl
daemon@ATHENA.MIT.EDU (nelhage@MIT.EDU)
Thu Oct 29 18:10:58 2009
Resent-From: nelhage@mit.edu
Resent-To: barnowl-dev-mtg@charon.mit.edu
To: dirty-owl-hackers@MIT.EDU
From: nelhage@MIT.EDU
Reply-to: dirty-owl-hackers@MIT.EDU
Date: Wed, 16 Jan 2008 22:24:42 -0500 (EST)
Author: nelhage
Date: 2008-01-16 22:24:41 -0500 (Wed, 16 Jan 2008)
New Revision: 891
Modified:
branches/barnowl_sqlite/owl/perlwrap.pm
Log:
Attempt to load BarnOwl::MessageList::SQL and error if it fails. Note
that the aforementioned class n'existe pas
Modified: branches/barnowl_sqlite/owl/perlwrap.pm
===================================================================
--- branches/barnowl_sqlite/owl/perlwrap.pm 2008-01-17 03:07:42 UTC (rev 890)
+++ branches/barnowl_sqlite/owl/perlwrap.pm 2008-01-17 03:24:41 UTC (rev 891)
@@ -138,6 +138,8 @@
# switch, if present.
our $configfile;
+our @__startup_errors = ();
+
if(!$configfile && -f $ENV{HOME} . "/.barnowlconf") {
$configfile = $ENV{HOME} . "/.barnowlconf";
}
@@ -291,6 +293,17 @@
package BarnOwl::MessageList;
sub new {
+ my $ml;
+ eval q{
+ use BarnOwl::MessageList::SQL;
+ $ml = BarnOwl::MessageList::SQL->new;
+ };
+
+ if($@) {
+ push @BarnOwl::__startup_errors, "Unable to load SQL message list\n$@";
+ } else {
+ return $ml;
+ }
my $class = shift;
my $self = {messages => {}};
return bless $self, $class;
@@ -792,6 +805,11 @@
# with compatibility by calling the old, fixed-name hooks.
sub _startup {
+ for my $e (@BarnOwl::__startup_errors) {
+ BarnOwl::admin_message('Startup', $e);
+ }
+ @BarnOwl::__startup_errors = ();
+
_load_owlconf();
if(eval {require BarnOwl::ModuleLoader}) {