Allow for default "assert" error message.
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 26 Mar 2010 11:15:47 +0000 (12:15 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Fri, 7 May 2010 12:49:26 +0000 (14:49 +0200)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
classes/platal.php

index c23fb53..69b1533 100644 (file)
@@ -423,7 +423,7 @@ abstract class Platal
         }
     }
 
-    public static function assert($cond, $error, $userfriendly)
+    public static function assert($cond, $error, $userfriendly = null)
     {
         global $globals;
         if ($cond === false) {
@@ -432,6 +432,11 @@ abstract class Platal
             fwrite($file, '<pre>' . pl_entities($error) . '</pre>\n');
             fclose($file);
 
+            if ($userfriendly == null) {
+                $userfriendly = "Une erreur interne s'est produite.
+                    Merci de réessayer la manipulation qui a déclenché l'erreur ;
+                    si cela ne fonctionne toujours pas, merci de nous signaler le problème rencontré.";
+            }
             Platal::page()->kill($userfriendly);
         }
     }