Bugfix for #325 and log errors

This commit is contained in:
the-djmaze 2022-04-18 19:24:06 +02:00
parent 334d3918c5
commit e53e21857e

View file

@ -444,6 +444,9 @@ class GPG
}
}
if (!$fingerprint) {
if (!empty($result['errors'])) {
\SnappyMail\Log::error('GPG', \implode("\n\t", $result['errors']));
}
return false;
}
@ -486,7 +489,7 @@ class GPG
$result = $this->exec($arguments);
foreach ($result['status'] as $line) {
if (\strpos($line, 'IMPORT_RES')) {
if (false !== \strpos($line, 'IMPORT_RES')) {
$line = \explode(' ', \explode('IMPORT_RES ', $line)[1]);
return [
'imported' => (int) $line[2],
@ -502,6 +505,10 @@ class GPG
}
}
if (!empty($result['errors'][0])) {
\SnappyMail\Log::warning('GPG', $result['errors'][0]);
}
return false;
}