Changeset 1963

Show
Ignore:
Timestamp:
09/25/06 17:36:43
Author:
miyagawa
Message:

some error check

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • misc/30boxes

    r1962 r1963  
    8686 
    8787sub parse_date { 
    88     my @date = localtime(UnixDate(ParseDateString(shift), "%s")); 
     88    my $time = UnixDate(ParseDateString($_[0]), "%s") or die "Can't parse '$_[0]' as a date string\n"; 
     89    my @date = localtime($time); 
     90 
    8991    return join '-', $date[5] + 1900, $date[4] + 1, $date[3]; 
    9092} 
     
    114116                       $args{start} ? (start => $args{start}) : (), 
    115117                       $args{end}   ? (end => $args{end}) : ()); 
     118 
     119    unless ($res->{eventList}->{event}) { 
     120        print "No event found.\n"; 
     121        exit; 
     122    } 
    116123 
    117124    my @events = @{ $res->{eventList}->{event} };