Skip to content

Commit

Permalink
show the error message to the user as flash message
Browse files Browse the repository at this point in the history
  • Loading branch information
moldcraft committed Dec 10, 2014
1 parent 536cf34 commit 0846868
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions extensions/github-update/class-fw-extension-github-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,15 @@ private function get_latest_version($user_slash_repo, $force_check, $title)
* Cache fake version to prevent requests to Github API on every refresh.
*/
$cache = array_merge($cache, array($user_slash_repo => $this->fake_latest_version));

/**
* Show the error to the user because it is not visible elsewhere
*/
FW_Flash_Messages::add(
'fw_ext_github_update_error',
$latest_version->get_error_message(),
'error'
);
} else {
$cache = array_merge($cache, array($user_slash_repo => $latest_version));
}
Expand Down

0 comments on commit 0846868

Please sign in to comment.