my($self, $svc_acct, $htmlref, $hashref) = @_;
my $dbh = DBI->connect( map $self->option($_), qw(datasrc username password) )
- or do { $hashref->{'error'} = "can't connect: ". $DBI::errstr; return; };
+ or return "can't connect: ". $DBI::errstr;
###
#vacation settings
###
my $vsth = $dbh->prepare('SELECT * FROM vacation WHERE email = ?')
- or do { $hashref->{'error'} = "can't prepare: ". $dbh->errstr; return; };
+ or return "can't prepare: ". $dbh->errstr;
$vsth->execute( $svc_acct->email )
- or do { $hashref->{'error'} = "can't execute: ". $vsth->errstr; return; };
+ or return "can't execute: ". $vsth->errstr;
my $vrow = $vsth->fetchrow_hashref;
if ( $vrow ) {
###
my $ssth = $dbh->prepare('SELECT * FROM users WHERE address = ?')
- or do { $hashref->{'error'} = "can't prepare: ". $dbh->errstr; return; };
+ or return "can't prepare: ". $dbh->errstr;
$ssth->execute( $svc_acct->email )
- or do { $hashref->{'error'} = "can't execute: ". $ssth->errstr; return; };
+ or return "can't execute: ". $ssth->errstr;
my $srow = $ssth->fetchrow_hashref;
if ( $srow ) {
#htmlref not implemented/used for this status export
+
+ ''; #no errors
+
}
1;
my %defaults = ();
my $error = $self->export('getsettings', \%settings, \%defaults);
if ( $error ) {
- #XXX bubble this up better
warn "error running export_getsetings: $error";
- return ( {}, {} );
+ return ( { 'error' => $error }, {} );
}
( \%settings, \%defaults );
}
my %hash = ();
my $error = $self->export('getstatus', \$html, \%hash);
if ( $error ) {
- #XXX bubble this up better
warn "error running export_getstatus: $error";
- return ( '', {} );
+ return ( '', { 'error' => $error } );
}
( $html, \%hash );
}