Changeset 10956


Ignore:
Timestamp:
2005-11-29T12:26:04+13:00 (18 years ago)
Author:
jrm21
Message:

now catch and exit if we got an error while parsing/evaling any
metadata callback function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/DBPlug.pm

    r10923 r10956  
    157157        }
    158158        $callback =~ s/sub (\w+?)_callback/sub/;
    159         my $fieldname=$1;
    160         eval "\$callbacks{'$fieldname'} = $callback ; 1";
     159        my $fieldname = $1;
     160        my $ret = eval "\$callbacks{'$fieldname'} = $callback ; 1";
     161        if (!defined($ret)) {
     162        print $outhandle "DBPlug: error eval'ing callback: $@\n";
     163        exit(1);
     164        }
    161165        $callback="";
     166        print $outhandle "DBPlug: callback registered for '$fieldname'\n"
     167            if $dbplug_debug;
    162168    } elsif ($callback) {
    163169        # add this line to the callback function
Note: See TracChangeset for help on using the changeset viewer.