代码拉取完成,页面将自动刷新
同步操作将从 Discuz/Discuz-Q-Docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
通常情况下PHP会抛出各种异常,或者自己定义的PHP 异常,也就是常用的 Exception,正常情况在如果程序不需要自定义异常返回的结果,可以直接忽略,如果某些异常需要自定义返回JSON返回相关信息,可以定义相关异常
<?php
namespace App\Api\Exceptions;
use Exception;
use Tobscure\JsonApi\Exception\Handler\ExceptionHandlerInterface;
use Tobscure\JsonApi\Exception\Handler\ResponseBag;
class NoExceptionHandler implements ExceptionHandlerInterface
{
/**
* If the exception handler is able to format a response for the provided exception,
* then the implementation should return true.
*
* @param \Exception $e
*
* @return bool
*/
public function manages(Exception $e)
{
// TODO: Implement manages() method.
return $e instanceof RouteNotFoundException;;
}
/**
* Handle the provided exception.
*
* @param \Exception $e
*
* @return \Tobscure\JsonApi\Exception\Handler\ResponseBag
*/
public function handle(Exception $e)
{
// TODO: Implement handle() method.
$status = 404;
$error = [
'status' => (string) $status,
'code' => 'route_not_found'
];
return new ResponseBag($status, [$error]);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。