More robust error handling in show-logo action
This commit is contained in:
parent
f6e23ab075
commit
14f37909d1
3 changed files with 36 additions and 23 deletions
|
@ -42,3 +42,33 @@ class Application_Common_HTTPHelper
|
|||
return $stationUrl;
|
||||
}
|
||||
}
|
||||
|
||||
class ZendActionHttpException extends Exception {
|
||||
|
||||
private $_action;
|
||||
|
||||
/**
|
||||
* @param Zend_Controller_Action $action
|
||||
* @param int $statusCode
|
||||
* @param string $message
|
||||
* @param int $code
|
||||
* @param Exception $previous
|
||||
*
|
||||
* @throws Zend_Controller_Response_Exception
|
||||
*/
|
||||
public function __construct(Zend_Controller_Action $action, $statusCode, $message,
|
||||
$code = 0, Exception $previous = null) {
|
||||
$this->_action = $action;
|
||||
Logging::info("Error in action " . $action->getRequest()->getActionName()
|
||||
. " with status code $statusCode: $message");
|
||||
$action->getResponse()
|
||||
->setHttpResponseCode($statusCode)
|
||||
->appendBody($message);
|
||||
parent::__construct($message, $code, $previous);
|
||||
}
|
||||
|
||||
public function getAction() {
|
||||
return $this->_action;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue