Error if the database isn't available

Instead of failing silently later
master
Daniel Berteaud 10 years ago
parent dcfc8c174d
commit c4b8fccb82
  1. 1
      lib/Vroom/I18N/en.pm
  2. 3
      lib/Vroom/I18N/fr.pm
  3. 9
      vroom.pl

@ -15,6 +15,7 @@ our %Lexicon = (
"ERROR_ROOM_s_LOCKED" => "The room %s is locked, you cannot join it", "ERROR_ROOM_s_LOCKED" => "The room %s is locked, you cannot join it",
"ERROR_OCCURRED" => "An error occurred", "ERROR_OCCURRED" => "An error occurred",
"ERROR_NOT_LOGGED_IN" => "Sorry, your not logged in", "ERROR_NOT_LOGGED_IN" => "Sorry, your not logged in",
"ERROR_DB_UNAVAILABLE" => "The database is not available",
"JS_REQUIRED" => "VROOM needs javascript to work properly", "JS_REQUIRED" => "VROOM needs javascript to work properly",
"EMAIL_INVITATION" => "Video conference invitation", "EMAIL_INVITATION" => "Video conference invitation",
"INVITE_SENT_TO_s" => "An invitation was sent to the following addresses\n%s", "INVITE_SENT_TO_s" => "An invitation was sent to the following addresses\n%s",

@ -16,7 +16,8 @@ our %Lexicon = (
"ERROR_ROOM_s_DOESNT_EXIST" => "Le salon %s n'existe pas", "ERROR_ROOM_s_DOESNT_EXIST" => "Le salon %s n'existe pas",
"ERROR_ROOM_s_LOCKED" => "Le salon %s est verrouillé, vous ne pouvez pas le rejoindre", "ERROR_ROOM_s_LOCKED" => "Le salon %s est verrouillé, vous ne pouvez pas le rejoindre",
"ERROR_OCCURRED" => "Une erreur est survenue", "ERROR_OCCURRED" => "Une erreur est survenue",
"ERROR_NOT_LOGGED_IN" => "Désolé, vous n'êtes pas identifié", "ERROR_NOT_LOGGED_IN" => "Désolé, vous n'êtes pas identifié",,
"ERROR_DB_UNAVAILABLE" => "La base de données n'est pas accessible",
"JS_REQUIRED" => "VROOM nécessite l'activation du javascript", "JS_REQUIRED" => "VROOM nécessite l'activation du javascript",
"EMAIL_INVITATION" => "Invitation à une conférence vidéo", "EMAIL_INVITATION" => "Invitation à une conférence vidéo",
"YOU_ARE_INVITED_TO_A_MEETING" => "Vous êtes attendu sur un salon de vidéo conférence. " . "YOU_ARE_INVITED_TO_A_MEETING" => "Vous êtes attendu sur un salon de vidéo conférence. " .

@ -1892,6 +1892,15 @@ app->hook(before_dispatch => sub {
} }
# Stash the configuration hashref # Stash the configuration hashref
$self->stash(config => $config); $self->stash(config => $config);
# Check db is available
if (!$self->db){
$self->app->log->info("Connect connect to the database");
return $self->render('error',
msg => $self->l('ERROR_DB_UNAVAILABLE'),
err => 'ERROR_DB_UNAVAILABLE'
);
}
}); });
# Are we running in hypnotoad ? # Are we running in hypnotoad ?
app->config( app->config(

Loading…
Cancel
Save