Skip to content

Commit

Permalink
0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
minecrafter committed May 12, 2017
1 parent ff8104a commit e3920f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: BuycraftPM
main: Buycraft\PocketMine\BuycraftPlugin
version: 0.2
version: 0.2.1
author: Tebex Limited
api: [2.0.0, 3.0.0, 3.0.0-ALPHA4, 3.0.0-ALPHA5]
13 changes: 12 additions & 1 deletion src/Buycraft/PocketMine/Util/AnalyticsSend.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Buycraft\PocketMine\BuycraftPlugin;
use pocketmine\scheduler\AsyncTask;
use pocketmine\Server;

class AnalyticsSend extends AsyncTask
{
Expand Down Expand Up @@ -60,10 +61,20 @@ public function onRun()
curl_setopt($ctx, CURLOPT_FAILONERROR, true);

$result = curl_exec($ctx);
$err = curl_error($ctx);
curl_close($ctx);

if ($result === FALSE) {
throw new \Exception("Unable to send analytics.");
$this->setResult("Unable to send analytics: " . $err);
}
}

public function onCompletion(Server $server)
{
$err = $this->getResult();
if ($err)
{
BuycraftPlugin::getInstance()->getLogger()->warning("Unable to send analytics: " . $err);
}
}
}

0 comments on commit e3920f9

Please sign in to comment.