Browse Source

Fixes #2139: error found while sending response is not displayed.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
d53f4dd9ea
  1. 5
      framework/web/Response.php

5
framework/web/Response.php

@ -293,8 +293,6 @@ class Response extends \yii\base\Response
{
if ($this->isSent) {
return;
} else {
$this->isSent = true;
}
$this->trigger(self::EVENT_BEFORE_SEND);
$this->prepare();
@ -302,6 +300,7 @@ class Response extends \yii\base\Response
$this->sendHeaders();
$this->sendContent();
$this->trigger(self::EVENT_AFTER_SEND);
$this->isSent = true;
}
/**
@ -875,7 +874,7 @@ class Response extends \yii\base\Response
if (method_exists($this->content, '__toString')) {
$this->content = $this->content->__toString();
} else {
throw new InvalidParamException("Response content can only be an object when it implements __toString() method.");
throw new InvalidParamException("Response content must be a string or an object implementing __toString().");
}
}
}

Loading…
Cancel
Save