Skip to content

Instantly share code, notes, and snippets.

@semifor
Created January 13, 2010 17:38
Show Gist options
  • Select an option

  • Save semifor/276390 to your computer and use it in GitHub Desktop.

Select an option

Save semifor/276390 to your computer and use it in GitHub Desktop.
sub twitter {
my ($self, $method, @args) = @_;
my $r = eval { $self->_twitter->$method(@args) };
if ( $@ ) {
if ( blessed $@ && $@->can('code') && $@->code == 502 ) {
$@ = 'Fail Whale';
}
$self->twitter_error("$method -> $@");
}
return $r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment