Commit 2f87f3bc44206ab890d568f27f3e96a855fa8142
1 parent
937b7b52
Accomodate (but not yet act on) exceptions/errors being passed through to
errorRedirectTo and errorPage. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4124 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
8 additions
and
3 deletions
lib/dispatcher.inc.php
| @@ -52,12 +52,15 @@ class KTDispatcher { | @@ -52,12 +52,15 @@ class KTDispatcher { | ||
| 52 | $this->bTransactionStarted = false; | 52 | $this->bTransactionStarted = false; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | - function errorRedirectTo($event, $error_message, $sQuery = "") { | 55 | + function errorRedirectTo($event, $error_message, $sQuery = "", $oException = null) { |
| 56 | if ($this->bTransactionStarted) { | 56 | if ($this->bTransactionStarted) { |
| 57 | $this->rollbackTransaction(); | 57 | $this->rollbackTransaction(); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| 60 | $_SESSION['KTErrorMessage'][] = $error_message; | 60 | $_SESSION['KTErrorMessage'][] = $error_message; |
| 61 | + /* if ($oException) { | ||
| 62 | + $_SESSION['Exception'][$error_message] = $oException; | ||
| 63 | + }*/ | ||
| 61 | $this->redirectTo($event, $sQuery); | 64 | $this->redirectTo($event, $sQuery); |
| 62 | } | 65 | } |
| 63 | 66 | ||
| @@ -210,11 +213,13 @@ class KTStandardDispatcher extends KTDispatcher { | @@ -210,11 +213,13 @@ class KTStandardDispatcher extends KTDispatcher { | ||
| 210 | $this->oPage->render(); | 213 | $this->oPage->render(); |
| 211 | } | 214 | } |
| 212 | 215 | ||
| 213 | - function errorPage($errorMessage) { | 216 | + function errorPage($errorMessage, $oException = null) { |
| 214 | if ($this->bTransactionStarted) { | 217 | if ($this->bTransactionStarted) { |
| 215 | $this->rollbackTransaction(); | 218 | $this->rollbackTransaction(); |
| 216 | } | 219 | } |
| 217 | - $this->handleOutput($errorMessage); | 220 | + $sOutput = $errorMessage; |
| 221 | + $sOutput .= $oException->getString(); | ||
| 222 | + $this->handleOutput($sOutput); | ||
| 218 | exit(0); | 223 | exit(0); |
| 219 | } | 224 | } |
| 220 | } | 225 | } |