Skip to content

Commit

Permalink
Dev: Include extension name in error message
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Oct 5, 2018
1 parent fb43a2a commit 04636b9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions application/core/plugins/UpdateCheck/UpdateCheck.php
Expand Up @@ -87,7 +87,7 @@ public function checkAll()
{
$service = \Yii::app()->extensionUpdaterServiceLocator;

// Get one updater class for each extension type (PluginUpdater, ThemeUpdater, etc).
// Get one updater class for each extension.
list($updaters, $errors) = $service->getAllUpdaters();

/** @var string[] */
Expand All @@ -106,18 +106,20 @@ public function checkAll()
$messages[] = $updater->getVersionMessage($versions);
}
} catch (\Throwable $ex) {
$errors[] = $ex->getMessage();
$errors[] = $updater->getExtensionName() . ': ' . $ex->getMessage();
}
}

// Compose notification.
if ($messages || $errors) {
$superadmins = User::model()->getSuperAdmins();
$title = $foundSecurityVersion ? gT('Security updates available') : gT('Updates available');
$displayClass = $foundSecurityVersion ? 'danger' : '';
$importance = $foundSecurityVersion ? Notification::HIGH_IMPORTANCE : Notification::NORMAL_IMPORTANCE;
$message = implode($messages);
if ($errors) {
$message .= '<hr/><i class="fa fa-warning"></i>&nbsp;' . gT('Errors happened during the update check. Please notify the extension authors for support.')
$message .= '<hr/><i class="fa fa-warning"></i>&nbsp;'
. gT('Errors happened during the update check. Please notify the extension authors for support.')
. '<ul>'
. '<li>' . implode('</li><li>', $errors) . '</li>';
}
Expand Down

0 comments on commit 04636b9

Please sign in to comment.