Skip to content
This repository was archived by the owner on Feb 2, 2018. It is now read-only.

Commit 13d394c

Browse files
committed
Timings verbose
1 parent 2644667 commit 13d394c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/pocketmine/command/defaults/TimingsCommand.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,14 @@ public function execute(CommandSender $sender, $currentAlias, array $args){
9595
curl_setopt($ch, CURLOPT_HEADER, true);
9696
curl_setopt($ch, CURLOPT_HTTPHEADER, ["User-Agent: " . $this->getName() . " " . $sender->getServer()->getPocketMineVersion()]);
9797
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
98-
$data = curl_exec($ch);
98+
try{
99+
$data = curl_exec($ch);
100+
if($data === false){
101+
throw new \Exception(curl_error($ch));
102+
}
103+
}catch(\Exception $e){
104+
$sender->getServer()->getLogger()->logException($e);
105+
}
99106
curl_close($ch);
100107
if(preg_match('#^Location: http://paste\\.ubuntu\\.com/([0-9]{1,})/#m', $data, $matches) == 0){
101108
$sender->sendMessage(new TranslationContainer("pocketmine.command.timings.pasteError"));

0 commit comments

Comments
 (0)