mirror of https://github.com/MISP/MISP
chg: [internal] Better error messages
parent
518b2faa94
commit
e1a97d6a76
|
@ -244,11 +244,12 @@ class CurlClient extends HttpSocketExtended
|
|||
$output = curl_exec($this->ch);
|
||||
|
||||
if ($output === false) {
|
||||
$errorCode = curl_errno($this->ch);
|
||||
$errorMessage = curl_error($this->ch);
|
||||
if (!empty($errorMessage)) {
|
||||
$errorMessage = ": $errorMessage";
|
||||
}
|
||||
throw new SocketException('curl error ' . curl_strerror(curl_errno($this->ch)) . $errorMessage);
|
||||
throw new SocketException("curl error $errorCode '" . curl_strerror($errorCode) . "'" . $errorMessage);
|
||||
}
|
||||
|
||||
$code = curl_getinfo($this->ch, CURLINFO_HTTP_CODE);
|
||||
|
|
|
@ -355,6 +355,14 @@ class ServerSyncTool
|
|||
return $this->server['Server']['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function serverName()
|
||||
{
|
||||
return $this->server['Server']['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -566,7 +566,7 @@ class Server extends AppModel
|
|||
$response = $serverSync->fetchEvent($eventId, $params);
|
||||
$event = $response->json();
|
||||
} catch (Exception $e) {
|
||||
$this->logException("Failed downloading the event $eventId from remote server {$serverSync->serverId()}", $e);
|
||||
$this->logException("Failed to download the event $eventId from remote server {$serverSync->serverId()} '{$serverSync->serverName()}'", $e);
|
||||
$fails[$eventId] = __('failed downloading the event');
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue