From d9dc0b7bdf8dd748880d2ba145768d0da8e52c34 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Wed, 6 May 2009 00:57:47 -0400 Subject: [PATCH] Make error messages more cli friendly. Signed-off-by: Edward Z. Yang --- XHTMLCompiler/Exception.php | 5 +++++ htaccess.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/XHTMLCompiler/Exception.php b/XHTMLCompiler/Exception.php index 2fdbb96..6fcb122 100644 --- a/XHTMLCompiler/Exception.php +++ b/XHTMLCompiler/Exception.php @@ -24,5 +24,10 @@ class XHTMLCompiler_Exception extends Exception /** Returns details of exception */ public function getDetails() {return $this->details;} + public function __toString() { + return $this->getCode() . ': ' . $this->getMessage() . "\n" . + $this->getDetails() . "\n\n" . parent::__toString() . "\n"; + } + } diff --git a/htaccess.php b/htaccess.php index 080ae74..6d07c40 100644 --- a/htaccess.php +++ b/htaccess.php @@ -40,7 +40,7 @@ if (file_exists('.htaccess')) { } if ($no_changes_needed) { - throw new XHTMLCompiler_Exception(503, false, + throw new XHTMLCompiler_Exception(503, 'Nop', 'No changes detected in relevant files'); } -- 2.11.4.GIT