当我第一次在离子框架中集成电容器时。
错误出现在这一行:
import { Plugins } from '@capacitor/core';
Run Code Online (Sandbox Code Playgroud)
找不到模块“@capacitor/core”.ts(2307)
我想在我的laravel 5 app中显示自定义错误页面.例如任何用户类型网址如http://www.app.com/url123(错误)但http://www.app.com/url(右)
默认错误显示为:
呃哦,出了点问题!错误代码:500
但相反,我想显示我的自定义视图
我怎么能这样做:我喜欢的一些链接但尚未实现
https://mattstauffer.co/blog/laravel-5.0-custom-error-pages#how-to
https://laracasts.com/discuss/channels/general-discussion/how-do-i-create-a-custom-404-error-page
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use symfony\http-kernel\Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class Handler extends ExceptionHandler {
protected $dontReport = [
'Symfony\Component\HttpKernel\Exception\HttpException'
];
public function report(Exception $e)
{
return parent::report($e);
}
public function render($request, Exception $e)
{
if ($this->isHttpException($e))
{
return $this->renderHttpException($e);
}
else if($e instanceof NotFoundHttpException)
{
return response()->view('missing', [], 404);
}
else
{
return parent::render($request, $e);
}
}
}
Run Code Online (Sandbox Code Playgroud)
我在:\ resources\views\errors\404.blade.php上创建了一个错误视图 …