mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Merge pull request #95 from pmmp/timings-verbose
Make /timings command more verbose about errors
This commit is contained in:
commit
0ac04b52ff
@ -114,7 +114,15 @@ class TimingsCommand extends VanillaCommand{
|
||||
curl_setopt($ch, CURLOPT_HEADER, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, ["User-Agent: " . $this->getName() . " " . $sender->getServer()->getPocketMineVersion()]);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
$data = curl_exec($ch);
|
||||
try{
|
||||
$data = curl_exec($ch);
|
||||
if($data === false){
|
||||
throw new \Exception(curl_error($ch));
|
||||
}
|
||||
}catch(\Exception $e){
|
||||
$sender->getServer()->getLogger()->logException($e);
|
||||
}
|
||||
|
||||
curl_close($ch);
|
||||
if(preg_match('#^Location: http://paste\\.ubuntu\\.com/([0-9]{1,})/#m', $data, $matches) == 0){
|
||||
$sender->sendMessage(new TranslationContainer("pocketmine.command.timings.pasteError"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user