Skip to content

Documenting how to get better error messages

    eval {
      my $account = $client->remote_follow($acct);
      push(@changes, $account);
    };
    if ($@) {
      push(@errors, "Could not follow $acct");
      next;
    }

In a situation such as this, I'd like to provide better error messages. Did we fail to follow because the server was not found? Because we're already following the account? I think what I want is access to the status code and status message, but all I have is $@. Unless there's a way to get it from $client -- in which case I couldn't find it in the documentation.