讨论数量:
@halweg 可以在 Service 中定义错误方法,然后在 Controller 里面获取错误内容
/**
* 错误代码
* @var int
*/
protected $errorCode;
/**
* 错误信息
* @var string
*/
protected $errorMessage = '';
/**
* 返回错误代码
* @return int
*/
public function getErrorCode()
{
return $this->errorCode;
}
/**
* 返回错误信息
* @return string
*/
public function getErrorMessage()
{
return $this->errorMessage;
}
关于 LearnKu
推荐文章: