/** * Constructor. * * @param array $config An optional KConfig object with configuration options. * * @return void */ public function __construct($errors = array(), $code = KHttpResponse::INTERNAL_SERVER_ERROR, Exception $previous = null) { foreach ($errors as $error) { $this->_errors[] = $error; } $message = KHttpResponse::getMessage($code); parent::__construct($message, $code, $previous); }
/** * Constructor * * @param string $message The exception message * @param integer $code The exception code * @param Exception $previous The previous exception */ public function __construct($message = null, $code = 0, Exception $previous = null) { parent::__construct($message, $code, $previous); $traces = $this->getTrace(); //Traverse up the trace stack to find the actual function that was not found if ($traces[0]['function'] == '__call') { foreach ($traces as $trace) { if ($trace['function'] != '__call') { $this->message = "Call to undefined method : " . $trace['class'] . $trace['type'] . $trace['function']; $this->file = $trace['file']; $this->line = $trace['line']; break; } } } }