
adeola at digitalcraftsmen
Apr 23, 2009, 2:04 AM
Views: 1944
Permalink
|
|
Getting Error with bric_soap & cron
|
|
Hi all, I have a cron job that calls: bric_soap --search desk_id=1036 story list_ids This runs ok usually but between 00:00 and 03:00 I often get an error: Can't call method "fault" on an undefined value at /usr/local/bricolage/bin/bric_soap line 436 Which points to this: 430 # login 431 if (!$use_cookie) { 432 print STDERR "$module $command: Authenticating to Bricolage...\n" 433 if $verbose; 434 my $response = $soap->login(name(username => $username), 435 name(password => $password)); 436 die "Login failed.\n" if $response->fault; # <<<--- ERROR HERE 437 print STDERR "$module $command: Login success.\n" if $verbose; 438 } else { 439 print STDERR "$module $command: Attempting to use cookie file $use_cookie\n" 440 if $verbose; 441 } So, Im guessing that this should probably re-written as: my $response = $soap->login(name(username => $username), name(password => $password)) || die "Login failed: $!\n"; And remove the line that checks for "$response->fault", since at the time $response would not be defined if the previous call to "$soap->login()" fails. I haven't tested this yet as it seems to be working for the moment. So, does this look like a good fix for the error I'm getting or is there a better way? Adeola. -- Creative Developer - Digital Craftsmen Ltd Exmouth House, 3 Pine Street London, EC1R 0JH t: +44 20 7183 1410 f: +44 20 7099 5140 m: +44 75 9527 7886 w: http://www.digitalcraftsmen.net/
|