Closed simplenotezy closed 8 years ago
This is probably because your views are broken, not this package?
Well I guess not, since if I change the ExceptionHandler to use the native App\Exceptions\Handler error pages are shown just fine.
Can I see your exception handler code?
This is all I have:
$app->singleton(
'Illuminate\Contracts\Debug\ExceptionHandler',
'GrahamCampbell\Exceptions\ExceptionHandler' // before: App\Exceptions\Handler.
);
This is all I have:
No it's not...
App\Exceptions\Handler error pages are shown just fine.
Telling me you have white page is a useless as saying "it's broken" with no context. Can you provide logs please.
<?php namespace App\Exceptions;
use Exception;
//use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
//use GrahamCampbell\Exceptions\ExceptionHandler as ExceptionHandler;
use Bugsnag\BugsnagLaravel\BugsnagExceptionHandler as ExceptionHandler;
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException;
use Illuminate\Auth\Access\AuthorizationException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Http\Exception\HttpResponseException;
class Handler extends ExceptionHandler {
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
NotFoundHttpException::class,
AuthorizationException::class,
HttpException::class,
ModelNotFoundException::class,
ValidationException::class,
];
/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
* @return void
*/
public function report(Exception $e)
{
return parent::report($e);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
return parent::render($request, $e);
}
}
For some strange reason, behavior has changed a bit... I'm sorry, it does not seem related to your package. However, the code you previously provided me, when trying to get Whoops + bugsnag to work, seems to be causing the issue. The Logger
library.
This is my Loggers config: <?php
/*
* This file is part of Alt Three Logger.
*
* (c) Alt Three Services Limited
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
/*
|--------------------------------------------------------------------------
| Loggers
|--------------------------------------------------------------------------
|
| Here are each of the loggers to call under the hood while logging.
|
*/
'loggers' => env('APP_DEBUG', false) ? ['Illuminate\Log\Writer' => ['*']] : [
'AltThree\Bugsnag\Logger' => ['error', 'critical', 'alert', 'emergency'],
'AltThree\Logify\Logger' => ['*']
],
];
When debugmode is OFF, views are not shown. When debugmode is on, views are shown.
So I figured it out; the logger.php
you previously pasted had "'AltThree\Logify\Logger" in the config, which is a library I do not have included. Changing this to Illuminate\Log\Writer
works fine. I'm sorry for the confusion.
Thanks for all your help.
However. When changing back to using your ExceptionsHandler, I simply get a 500 error page if debug mode is off, instead of seeing the expected 500 view.
Nothing is in the error.log. I see this page:
So when using ->firstOrFail() (forcing it to fail) it generates this 500 error page:
I would expect to see a 404 page.
I would expect to see a 404 page.
As I said, I'd say 500 is correct, but I'd like to add the transformer so that people can transform it to 404.
After installing this package, our 404, 500, 503, etc pages are gone. All we get is a white page.
In
bootstrap/app.php
this is how I call your exceptionhandlerIf I change the ExceptionHandler to use the native
App\Exceptions\Handler
error pages are shown just fine. Therefore it must be something to do with your package.If debugmode is
true
I see default Whoops page. If debug mode isfalse
I see white pages.