changeset 66:de14128c1858

Switching to eval for update error handling
author Dominic Cleal <dominic@computerkb.co.uk>
date Sat, 21 Nov 2009 12:40:32 +0000
parents 962dada7587e
children 5db6fd5ffe17
files skillbot.pl
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/skillbot.pl	Sat Nov 21 12:31:28 2009 +0000
+++ b/skillbot.pl	Sat Nov 21 12:40:32 2009 +0000
@@ -488,9 +488,12 @@
 	my $f = shift;
 
     # Don't attempt updates during downtime, can cause crash
-	return if (timestamp_in_downtime(time));
+	# return if (timestamp_in_downtime(time));
 
-	my $char_skill = $f->{char_api}->skill;
+	my $char_skill;
+	eval { $char_skill = $f->{char_api}->skill; }
+	warn $@ if $@;
+	
 	# Sometimes this is undefined if there's an API error, try later
 	return unless defined $char_skill;
 
@@ -513,7 +516,7 @@
 		# If the skill's the same, check the finish time and skip if
 		# nothing's changed
 		return if ($skill->id eq $f->{skill}
-				&& $f{$f->{skill_finish} == $skill->finish_time);
+				&& $f->{skill_finish} == $skill->finish_time);
 		
 		# Skill or finish time has changed, delete previous announcement
 		del_one_shot_timer($f->{timer});