mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-24 04:14:07 +00:00
Server: tell me what is wrong when crash archive submission fails
This commit is contained in:
parent
03e8cd3ed4
commit
f4ee2912db
@ -2091,17 +2091,24 @@ class Server{
|
|||||||
|
|
||||||
if($report){
|
if($report){
|
||||||
$url = ((bool) $this->getProperty("auto-report.use-https", true) ? "https" : "http") . "://" . $this->getProperty("auto-report.host", "crash.pmmp.io") . "/submit/api";
|
$url = ((bool) $this->getProperty("auto-report.use-https", true) ? "https" : "http") . "://" . $this->getProperty("auto-report.host", "crash.pmmp.io") . "/submit/api";
|
||||||
|
$postUrlError = "Unknown error";
|
||||||
$reply = Internet::postURL($url, [
|
$reply = Internet::postURL($url, [
|
||||||
"report" => "yes",
|
"report" => "yes",
|
||||||
"name" => $this->getName() . " " . $this->getPocketMineVersion(),
|
"name" => $this->getName() . " " . $this->getPocketMineVersion(),
|
||||||
"email" => "crash@pocketmine.net",
|
"email" => "crash@pocketmine.net",
|
||||||
"reportPaste" => base64_encode($dump->getEncodedData())
|
"reportPaste" => base64_encode($dump->getEncodedData())
|
||||||
]);
|
], 10, [], $postUrlError);
|
||||||
|
|
||||||
if($reply !== false and ($data = json_decode($reply)) !== null and isset($data->crashId) and isset($data->crashUrl)){
|
if($reply !== false and ($data = json_decode($reply)) !== null){
|
||||||
$reportId = $data->crashId;
|
if(isset($data->crashId) and isset($data->crashUrl)){
|
||||||
$reportUrl = $data->crashUrl;
|
$reportId = $data->crashId;
|
||||||
$this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.archive", [$reportUrl, $reportId]));
|
$reportUrl = $data->crashUrl;
|
||||||
|
$this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.archive", [$reportUrl, $reportId]));
|
||||||
|
}elseif(isset($data->error)){
|
||||||
|
$this->logger->emergency("Automatic crash report submission failed: $data->error");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$this->logger->emergency("Failed to communicate with crash archive: $postUrlError");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user