Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print nice errors to the screen #362

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions islandora_solr.module
Original file line number Diff line number Diff line change
Expand Up @@ -641,12 +641,12 @@ function islandora_solr_preprocess_islandora_objects_subset(&$variables) {
*/
function islandora_solr_technical_difficulties(Exception $e) {
// Only report the error once per screen.
$islandora_solr_error_reported = &drupal_static(__FUNCTION__, false);
$islandora_solr_error_reported = &drupal_static(__FUNCTION__, FALSE);

if ($islandora_solr_error_reported !== true) {
if ($islandora_solr_error_reported !== TRUE) {
$message = "We are experiencing technical difficulties at this time and are working to fix the problem. Please try back later.";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final request. Could we have a way of customizing this message? Since it's front facing.. i know i know we did not have it before so why now? Because people i know will ask for it for sure.. maybe a hook-ie? i mean, its not a blocker... since you can always disable reporting at all...but could be cool? sorry

drupal_set_message(t($message), 'warning');
watchdog("manidora", "Received exception @code: @message\nLine: @line in file: @file", array(
drupal_set_message(t("@message", array('@message' => $message)), 'warning');
watchdog("islandora_solr", "Received exception @code: @message\nLine: @line in file: @file", array(
'@code' => $e->getCode(),
'@message' => $e->getMessage(),
'@file' => $e->getFile(),
Expand Down