Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

do not die on recycle failure

  • Loading branch information...
commit f9279dab4799dce0930da5cafcab67fe08bb9bb4 1 parent 121f079
@codon codon authored
Showing with 13 additions and 2 deletions.
  1. +13 −2 haste.pl
View
15 haste.pl
@@ -477,8 +477,19 @@ sub recycle {
$recycled{ $res } += $recycle{ $res };
}
- $client->recycle_recycle($center->{id}, $recycle{water}, $recycle{ore}, $recycle{energy}, $center->{url})
- unless $opts{'dry-run'};
+ eval {
+ $client->recycle_recycle(
+ $center->{id},
+ $recycle{water}, $recycle{ore}, $recycle{energy},
+ $center->{url},
+ ) unless $opts{'dry-run'};
+ };
+
+ if ($@) {
+ warn $@;
+ next;
+ }
+
output("Recycled for $recycle{ore} ore, $recycle{water} water, and $recycle{energy} energy.");
$left_to_recycle -= $recycle_capacity;
}
Please sign in to comment.
Something went wrong with that request. Please try again.