Code Monkey home page Code Monkey logo

ignition's Introduction

Ignition: a beautiful error page for PHP apps

Latest Version on Packagist Run tests Total Downloads

Ignition is a beautiful and customizable error page for PHP applications

Here's a minimal example on how to register ignition.

use Spatie\Ignition\Ignition;

include 'vendor/autoload.php';

Ignition::make()->register();

Let's now throw an exception during a web request.

throw new Exception('Bye world');

This is what you'll see in the browser.

Screenshot of ignition

There's also a beautiful dark mode.

Screenshot of ignition in dark mode

Are you a visual learner?

In this video on YouTube, you'll see a demo of all of the features.

Do know more about the design decisions we made, read this blog post.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

For Laravel apps, head over to laravel-ignition.

For Symfony apps, go to symfony-ignition-bundle.

For Drupal 10+ websites, use the Ignition module.

For OpenMage websites, use the Ignition module.

For all other PHP projects, install the package via composer:

composer require spatie/ignition

Usage

In order to display the Ignition error page when an error occurs in your project, you must add this code. Typically, this would be done in the bootstrap part of your application.

\Spatie\Ignition\Ignition::make()->register();

Setting the application path

When setting the application path, Ignition will trim the given value from all paths. This will make the error page look more cleaner.

\Spatie\Ignition\Ignition::make()
    ->applicationPath($basePathOfYourApplication)
    ->register();

Using dark mode

By default, Ignition uses a nice white based theme. If this is too bright for your eyes, you can use dark mode.

\Spatie\Ignition\Ignition::make()
    ->useDarkMode()
    ->register();

Avoid rendering Ignition in a production environment

You don't want to render the Ignition error page in a production environment, as it potentially can display sensitive information.

To avoid rendering Ignition, you can call shouldDisplayException and pass it a falsy value.

\Spatie\Ignition\Ignition::make()
    ->shouldDisplayException($inLocalEnvironment)
    ->register();

Displaying solutions

In addition to displaying an exception, Ignition can display a solution as well.

Out of the box, Ignition will display solutions for common errors such as bad methods calls, or using undefined properties.

Adding a solution directly to an exception

To add a solution text to your exception, let the exception implement the Spatie\Ignition\Contracts\ProvidesSolution interface.

This interface requires you to implement one method, which is going to return the Solution that users will see when the exception gets thrown.

use Spatie\Ignition\Contracts\Solution;
use Spatie\Ignition\Contracts\ProvidesSolution;

class CustomException extends Exception implements ProvidesSolution
{
    public function getSolution(): Solution
    {
        return new CustomSolution();
    }
}
use Spatie\Ignition\Contracts\Solution;

class CustomSolution implements Solution
{
    public function getSolutionTitle(): string
    {
        return 'The solution title goes here';
    }

    public function getSolutionDescription(): string
    {
        return 'This is a longer description of the solution that you want to show.';
    }

    public function getDocumentationLinks(): array
    {
        return [
            'Your documentation' => 'https://your-project.com/relevant-docs-page',
        ];
    }
}

This is how the exception would be displayed if you were to throw it.

Screenshot of solution

Using solution providers

Instead of adding solutions to exceptions directly, you can also create a solution provider. While exceptions that return a solution, provide the solution directly to Ignition, a solution provider allows you to figure out if an exception can be solved.

For example, you could create a custom "Stack Overflow solution provider", that will look up if a solution can be found for a given throwable.

Solution providers can be added by third party packages or within your own application.

A solution provider is any class that implements the \Spatie\Ignition\Contracts\HasSolutionsForThrowable interface.

This is how the interface looks like:

interface HasSolutionsForThrowable
{
    public function canSolve(Throwable $throwable): bool;

    /** @return \Spatie\Ignition\Contracts\Solution[] */
    public function getSolutions(Throwable $throwable): array;
}

When an error occurs in your app, the class will receive the Throwable in the canSolve method. In that method you can decide if your solution provider is applicable to the Throwable passed. If you return true, getSolutions will get called.

To register a solution provider to Ignition you must call the addSolutionProviders method.

\Spatie\Ignition\Ignition::make()
    ->addSolutionProviders([
        YourSolutionProvider::class,
        AnotherSolutionProvider::class,
    ])
    ->register();

AI powered solutions

Ignition can send your exception to Open AI that will attempt to automatically suggest a solution. In many cases, the suggested solutions is quite useful, but keep in mind that the solution may not be 100% correct for your context.

To generate AI powered solutions, you must first install this optional dependency.

composer require openai-php/client

To start sending your errors to OpenAI, you must instanciate the OpenAiSolutionProvider. The constructor expects a OpenAI API key to be passed, you should generate this key at OpenAI.

use \Spatie\Ignition\Solutions\OpenAi\OpenAiSolutionProvider;

$aiSolutionProvider = new OpenAiSolutionProvider($openAiKey);

To use the solution provider, you should pass it to addSolutionProviders when registering Ignition.

\Spatie\Ignition\Ignition::make()
    ->addSolutionProviders([
        $aiSolutionProvider,
        // other solution providers...
    ])
    ->register();

By default, the solution provider will send these bits of info to Open AI:

  • the error message
  • the error class
  • the stack frame
  • other small bits of info of context surrounding your error

It will not send the request payload or any environment variables to avoid sending sensitive data to OpenAI.

Caching requests to AI

By default, all errors will be sent to OpenAI. Optionally, you can add caching so similar errors will only get sent to OpenAI once. To cache errors, you can call useCache on $aiSolutionProvider. You should pass a simple-cache-implementation. Here's the signature of the useCache method.

public function useCache(CacheInterface $cache, int $cacheTtlInSeconds = 60 * 60)

Hinting the application type

To increase the quality of the suggested solutions, you can send along the application type (Symfony, Drupal, WordPress, ...) to the AI.

To send the application type call applicationType on the solution provider.

$aiSolutionProvider->applicationType('WordPress 6.2')

Sending exceptions to Flare

Ignition comes with the ability to send exceptions to Flare, an exception monitoring service. Flare can notify you when new exceptions are occurring in your production environment.

To send exceptions to Flare, simply call the sendToFlareMethod and pass it the API key you got when creating a project on Flare.

You probably want to combine this with calling runningInProductionEnvironment. That method will, when passed a truthy value, not display the Ignition error page, but only send the exception to Flare.

\Spatie\Ignition\Ignition::make()
    ->runningInProductionEnvironment($boolean)
    ->sendToFlare($yourApiKey)
    ->register();

When you pass a falsy value to runningInProductionEnvironment, the Ignition error page will get shown, but no exceptions will be sent to Flare.

Sending custom context to Flare

When you send an error to Flare, you can add custom information that will be sent along with every exception that happens in your application. This can be very useful if you want to provide key-value related information that furthermore helps you to debug a possible exception.

use Spatie\FlareClient\Flare;

\Spatie\Ignition\Ignition::make()
    ->runningInProductionEnvironment($boolean)
    ->sendToFlare($yourApiKey)
    ->configureFlare(function(Flare  $flare) {
        $flare->context('Tenant', 'My-Tenant-Identifier');
    })
    ->register();

Sometimes you may want to group your context items by a key that you provide to have an easier visual differentiation when you look at your custom context items.

The Flare client allows you to also provide your own custom context groups like this:

use Spatie\FlareClient\Flare;

\Spatie\Ignition\Ignition::make()
    ->runningInProductionEnvironment($boolean)
    ->sendToFlare($yourApiKey)
    ->configureFlare(function(Flare  $flare) {
        $flare->group('Custom information', [
            'key' => 'value',
            'another key' => 'another value',
        ]);
    })
    ->register();

Anonymize request to Flare

By default, the Ignition collects information about the IP address of your application users. If you don't want to send this information to Flare, call anonymizeIp().

use Spatie\FlareClient\Flare;

\Spatie\Ignition\Ignition::make()
    ->runningInProductionEnvironment($boolean)
    ->sendToFlare($yourApiKey)
    ->configureFlare(function(Flare  $flare) {
        $flare->anonymizeIp();
    })
    ->register();

Censoring request body fields

When an exception occurs in a web request, the Flare client will pass on any request fields that are present in the body.

In some cases, such as a login page, these request fields may contain a password that you don't want to send to Flare.

To censor out values of certain fields, you can use censorRequestBodyFields. You should pass it the names of the fields you wish to censor.

use Spatie\FlareClient\Flare;

\Spatie\Ignition\Ignition::make()
    ->runningInProductionEnvironment($boolean)
    ->sendToFlare($yourApiKey)
    ->configureFlare(function(Flare  $flare) {
        $flare->censorRequestBodyFields(['password']);
    })
    ->register();

This will replace the value of any sent fields named "password" with the value "".

Using middleware to modify data sent to Flare

Before Flare receives the data that was collected from your local exception, we give you the ability to call custom middleware methods. These methods retrieve the report that should be sent to Flare and allow you to add custom information to that report.

A valid middleware is any class that implements FlareMiddleware.

use Spatie\FlareClient\Report;

use Spatie\FlareClient\FlareMiddleware\FlareMiddleware;

class MyMiddleware implements FlareMiddleware
{
    public function handle(Report $report, Closure $next)
    {
        $report->message("{$report->getMessage()}, now modified");

        return $next($report);
    }
}
use Spatie\FlareClient\Flare;

\Spatie\Ignition\Ignition::make()
    ->runningInProductionEnvironment($boolean)
    ->sendToFlare($yourApiKey)
    ->configureFlare(function(Flare  $flare) {
        $flare->registerMiddleware([
            MyMiddleware::class,
        ])
    })
    ->register();

Changelog

Please see CHANGELOG for more information about what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Dev setup

Here are the steps you'll need to perform if you want to work on the UI of Ignition.

  • clone (or move) spatie/ignition, spatie/ignition-ui, spatie/laravel-ignition, spatie/flare-client-php and spatie/ignition-test into the same directory (e.g. ~/code/flare)
  • create a new package.json file in ~/code/flare directory:
{
    "private": true,
    "workspaces": [
        "ignition-ui",
        "ignition"
    ]
}
  • run yarn install in the ~/code/flare directory
  • in the ~/code/flare/ignition-test directory
    • run composer update
    • run cp .env.example .env
    • run php artisan key:generate
  • run yarn dev in both the ignition and ignition-ui project
  • http://ignition-test.test/ should now work (= show the new UI). If you use valet, you might want to run valet park inside the ~/code/flare directory.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

ignition's People

Contributors

abenerd avatar adrianmrn avatar alexvanderbist avatar angeljqv avatar dependabot[bot] avatar dieterholvoet avatar driesvints avatar freekmurze avatar github-actions[bot] avatar imliam avatar innocenzi avatar jubeki avatar knorthfield avatar kudashevs avatar laravel-shift avatar leafling avatar mansoorkhan96 avatar netpalantir avatar nunomaduro avatar paolaruby avatar patinthehat avatar raveren avatar riasvdv avatar robertboes avatar rubenvanassche avatar supianidz avatar timvandijck avatar tyler36 avatar willemvb avatar woutervdwaal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ignition's Issues

TypeError: undefined is not an object (evaluating 'n.code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

XE@http://localhost/laravel-crud/public/:72:249980
mi@http://localhost/laravel-crud/public/:72:70707
Ql@http://localhost/laravel-crud/public/:72:122310
xc@http://localhost/laravel-crud/public/:72:109799
_c@http://localhost/laravel-crud/public/:72:109727
Cc@http://localhost/laravel-crud/public/:72:109590
Nc@http://localhost/laravel-crud/public/:72:106584
hc@http://localhost/laravel-crud/public/:72:103960
nu@http://localhost/laravel-crud/public/:72:119818
@http://localhost/laravel-crud/public/:72:121189
Oc@http://localhost/laravel-crud/public/:72:106961
cu@http://localhost/laravel-crud/public/:72:121175
render@http://localhost/laravel-crud/public/:72:128585
@http://localhost/laravel-crud/public/:72:496823
global code@http://localhost/laravel-crud/public/:76:18

User Agent

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15

TypeError: Cannot read properties of undefined (reading 'code_snippet')

TypeError: Cannot read properties of undefined (reading 'code_snippet') at zE (http://127.0.0.1:8000/:72:257091) at mi (http://127.0.0.1:8000/:72:70706) at Ql (http://127.0.0.1:8000/:72:122308) at xc (http://127.0.0.1:8000/:72:109797) at _c (http://127.0.0.1:8000/:72:109725) at Cc (http://127.0.0.1:8000/:72:109588) at Nc (http://127.0.0.1:8000/:72:106582) at hc (http://127.0.0.1:8000/:72:103958) at nu (http://127.0.0.1:8000/:72:119816) at http://127.0.0.1:8000/:72:121187

TypeError: undefined is not an object (evaluating 'n.code_snippet')

zE@http://10.10.10.109/:72:257090mi@http://10.10.10.109/:72:70707Ql@http://10.10.10.109/:72:122310xc@http://10.10.10.109/:72:109799_c@http://10.10.10.109/:72:109727Cc@http://10.10.10.109/:72:109590Nc@http://10.10.10.109/:72:106584hc@http://10.10.10.109/:72:103960nu@http://10.10.10.109/:72:119818@http://10.10.10.109/:72:121189Oc@http://10.10.10.109/:72:106961cu@http://10.10.10.109/:72:121175render@http://10.10.10.109/:72:128585@http://10.10.10.109/:72:508570global code@http://10.10.10.109/:76:18

package only for laravel?

Adds functionality from laravel/illuminate. I understand it is not used. For example env(). This function creates a conflict: "Fatal error: Cannot redeclare env()". Use in other projects becomes impossible.

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://10.3.1.125/:72:249981)
    at mi (http://10.3.1.125/:72:70706)
    at Ql (http://10.3.1.125/:72:122308)
    at xc (http://10.3.1.125/:72:109797)
    at _c (http://10.3.1.125/:72:109725)
    at Cc (http://10.3.1.125/:72:109588)
    at Nc (http://10.3.1.125/:72:106582)
    at hc (http://10.3.1.125/:72:103958)
    at nu (http://10.3.1.125/:72:119816)
    at http://10.3.1.125/:72:121187

User Agent

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36

Cannot properly render the debugger for my php script

Just followed the minimal example... did I miss something?
Of course, I've installed the package like so: composer require spatie/ignition

<?php // ./app/index.php

namespace App;

use Spatie\Ignition\Ignition;

require __DIR__ . '/../vendor/autoload.php';

Ignition::make()->register();

throw new Exception('Bye world');

My directory structure:

.
โ”œโ”€โ”€ app
โ”‚   โ””โ”€โ”€ index.php
โ”œโ”€โ”€ bin
โ”‚   โ””โ”€โ”€ composer
โ”œโ”€โ”€ composer.json
โ”œโ”€โ”€ composer.lock
โ”œโ”€โ”€ docker-compose.yml
โ””โ”€โ”€ vendor
    โ”œโ”€โ”€ autoload.php
    โ”œโ”€โ”€ bin
    โ”œโ”€โ”€ composer
    โ”œโ”€โ”€ doctrine
    โ””โ”€โ”€ ...

And my docker-compose.yml:

version: '3'
services:
  app:
    image: php:8.1-apache
    ports:
      - 89:80
    volumes:
      - .:/var/www/html

Capture dโ€™eฬcran 2021-12-16 aฬ€ 19 33 28

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://localhost/:72:249981)
    at mi (http://localhost/:72:70706)
    at Ql (http://localhost/:72:122308)
    at xc (http://localhost/:72:109797)
    at _c (http://localhost/:72:109725)
    at Cc (http://localhost/:72:109588)
    at Nc (http://localhost/:72:106582)
    at hc (http://localhost/:72:103958)
    at nu (http://localhost/:72:119816)
    at http://localhost/:72:121187

User Agent

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36

TypeError: n is undefined

I had a file with char before PHP declatation. Example:

i<?php

namespace ...

Ignition was unable to correctly report the error while in my logs I had:

Namespace declaration statement has to be the very first statement or after any declare call in the script

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://164.92.76.135/:72:249981)
    at mi (http://164.92.76.135/:72:70706)
    at Ql (http://164.92.76.135/:72:122308)
    at xc (http://164.92.76.135/:72:109797)
    at _c (http://164.92.76.135/:72:109725)
    at Cc (http://164.92.76.135/:72:109588)
    at Nc (http://164.92.76.135/:72:106582)
    at hc (http://164.92.76.135/:72:103958)
    at nu (http://164.92.76.135/:72:119816)
    at http://164.92.76.135/:72:121187

User Agent

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://localhost/:72:249981)
    at mi (http://localhost/:72:70706)
    at Ql (http://localhost/:72:122308)
    at xc (http://localhost/:72:109797)
    at _c (http://localhost/:72:109725)
    at Cc (http://localhost/:72:109588)
    at Nc (http://localhost/:72:106582)
    at hc (http://localhost/:72:103958)
    at nu (http://localhost/:72:119816)
    at http://localhost/:72:121187

User Agent

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36

User section breaks when using laravel-translatable

tasks_one:160 Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%24%24typeof%2C%20type%2C%20key%2C%20ref%2C%20props%2C%20_owner%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at wo (tasks_one:160:62874)
at tasks_one:160:67682
at Gi (tasks_one:160:78640)
at qi (tasks_one:160:80132)
at Jl (tasks_one:160:123161)
at wc (tasks_one:160:109704)
at Cc (tasks_one:160:109632)
at Lc (tasks_one:160:109495)
at bc (tasks_one:160:106489)
at tasks_one:160:56585
ml @ tasks_one:160
tasks_one:160 Uncaught Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7B%24%24typeof%2C%20type%2C%20key%2C%20ref%2C%20props%2C%20_owner%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
at wo (tasks_one:160:62874)
at tasks_one:160:67682
at Gi (tasks_one:160:78640)
at qi (tasks_one:160:80132)
at Jl (tasks_one:160:123161)
at wc (tasks_one:160:109704)
at Cc (tasks_one:160:109632)
at Lc (tasks_one:160:109495)
at bc (tasks_one:160:106489)
at tasks_one:160:56585
tasks_one#F46:1 Failed to load resource: the server responded with a status of 500 (Internal Server Error)

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://localhost/:72:249981)
    at mi (http://localhost/:72:70706)
    at Ql (http://localhost/:72:122308)
    at xc (http://localhost/:72:109797)
    at _c (http://localhost/:72:109725)
    at Cc (http://localhost/:72:109588)
    at Nc (http://localhost/:72:106582)
    at hc (http://localhost/:72:103958)
    at nu (http://localhost/:72:119816)
    at http://localhost/:72:121187

User Agent

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://laravel9.test/:72:249981)
    at mi (http://laravel9.test/:72:70706)
    at Ql (http://laravel9.test/:72:122308)
    at xc (http://laravel9.test/:72:109797)
    at _c (http://laravel9.test/:72:109725)
    at Cc (http://laravel9.test/:72:109588)
    at Nc (http://laravel9.test/:72:106582)
    at hc (http://laravel9.test/:72:103958)
    at nu (http://laravel9.test/:72:119816)
    at http://laravel9.test/:72:121187

User Agent

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36 Edg/98.0.1108.62

TypeError: n is undefined

zE@http://212.106.73.53/:72:257075mi@http://212.106.73.53/:72:70706Ql@http://212.106.73.53/:72:122308xc@http://212.106.73.53/:72:109799_c@http://212.106.73.53/:72:109727Cc@http://212.106.73.53/:72:109588Nc@http://212.106.73.53/:72:106582hc@http://212.106.73.53/:72:103958nu@http://212.106.73.53/:72:119816cu/<@http://212.106.73.53/:72:121189Oc@http://212.106.73.53/:72:106960cu@http://212.106.73.53/:72:121175render@http://212.106.73.53/:72:128583window.ignite@http://212.106.73.53/:72:508564@http://212.106.73.53/:76:12

spatie/ignition default config outside of appdir open_basedir issue

Hello there,

This issue seems to be caused by spatie/ignition package.

Steps to reproduce:

  1. Have a Laravel 8.xx app and open_basedir restrictions set to the application directory
  2. replace facade/ignition with spatie/laravel-ignition

I can confirm that homedir being the default path causes the issue after changing the default path to base_path everything works normally.

This can cause problems with the upcoming Laravel 9 release, as there it is the default.

cheers

Prevent Infinite Loops on User Context

Original report by @troy-whitespark: spatie/flareapp.io-roadmap#35 (and https://github.com/facade/ignition/issues/396)

Currently, the flare app automatically serializes the User model (which is certainly helpful).

However, if there is complexity in the fields of a User, an infinite loop can occur. Consider the following example pseudocode that just happened in our environment:

class User {
    protected $appends [ 'latest_invoice_amount'];
    getLatestInvoiceAmountAttribute() {
        try { 
            return $user->getDataFromStripe();
         } catch (StripeException $exception) {
            Flare::report($exception);
            return 0;
        }
    }
}

We try to get notified in the case where everything goes wrong... which causes everything to go much worse. If you report a flare error in any User method that's called upon serialization, you've got an infinite loop which breaks the whole app simply because you tried to report something went wrong.

Yes, I'm aware we can configure the User's ->toFlare() method and serialize less (and we did that). I suggest that the error handler should come with some rudimentary checks to ensure the error handler itself is not causing the problem.

Thanks!

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://0.0.0.0/:72:249981)
    at mi (http://0.0.0.0/:72:70706)
    at Ql (http://0.0.0.0/:72:122308)
    at xc (http://0.0.0.0/:72:109797)
    at _c (http://0.0.0.0/:72:109725)
    at Cc (http://0.0.0.0/:72:109588)
    at Nc (http://0.0.0.0/:72:106582)
    at hc (http://0.0.0.0/:72:103958)
    at nu (http://0.0.0.0/:72:119816)
    at http://0.0.0.0/:72:121187

User Agent

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36

TypeError: Cannot read properties of undefined (reading 'code_snippet')

TypeError: Cannot read properties of undefined (reading 'code_snippet') at zE (https://gf.cadabra.rcvn.work/admin:72:257091) at mi (https://gf.cadabra.rcvn.work/admin:72:70706) at Ql (https://gf.cadabra.rcvn.work/admin:72:122308) at xc (https://gf.cadabra.rcvn.work/admin:72:109797) at _c (https://gf.cadabra.rcvn.work/admin:72:109725) at Cc (https://gf.cadabra.rcvn.work/admin:72:109588) at Nc (https://gf.cadabra.rcvn.work/admin:72:106582) at hc (https://gf.cadabra.rcvn.work/admin:72:103958) at nu (https://gf.cadabra.rcvn.work/admin:72:119816) at https://gf.cadabra.rcvn.work/admin:72:121187

Slow ReportTrimmer

Hey,

when working with Livewire and when there is a error in the view I always get 504 Timeouts.
So I used ray()->measure(); to find out where it is slow.
I found that (new ReportTrimmer())->trim($payload) seems to be real slow. I get ~30 seconds per loop in the trim function.
Don't know why... sorry. Maybe the views are too big? The exception is real fast in ray.

I have Laravel 9.2 and tried php 8.1 and 8.0.

TypeError: Cannot read properties of undefined (reading 'code_snippet')

TypeError: Cannot read properties of undefined (reading 'code_snippet') at zE (http://laravelraj.net/:72:257091) at mi (http://laravelraj.net/:72:70706) at Ql (http://laravelraj.net/:72:122308) at xc (http://laravelraj.net/:72:109797) at _c (http://laravelraj.net/:72:109725) at Cc (http://laravelraj.net/:72:109588) at Nc (http://laravelraj.net/:72:106582) at hc (http://laravelraj.net/:72:103958) at nu (http://laravelraj.net/:72:119816) at http://laravelraj.net/:72:121187

TypeError: Cannot read properties of undefined (reading 'code_snippet')

TypeError: Cannot read properties of undefined (reading 'code_snippet') at zE (http://localhost/dynamic_filter/public/:72:257091) at mi (http://localhost/dynamic_filter/public/:72:70706) at Ql (http://localhost/dynamic_filter/public/:72:122308) at xc (http://localhost/dynamic_filter/public/:72:109797) at _c (http://localhost/dynamic_filter/public/:72:109725) at Cc (http://localhost/dynamic_filter/public/:72:109588) at Nc (http://localhost/dynamic_filter/public/:72:106582) at hc (http://localhost/dynamic_filter/public/:72:103958) at nu (http://localhost/dynamic_filter/public/:72:119816) at http://localhost/dynamic_filter/public/:72:121187

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://0.0.0.0/:74:249981)
    at mi (http://0.0.0.0/:74:70706)
    at Ql (http://0.0.0.0/:74:122308)
    at xc (http://0.0.0.0/:74:109797)
    at _c (http://0.0.0.0/:74:109725)
    at Cc (http://0.0.0.0/:74:109588)
    at Nc (http://0.0.0.0/:74:106582)
    at hc (http://0.0.0.0/:74:103958)
    at nu (http://0.0.0.0/:74:119816)
    at http://0.0.0.0/:74:121187

User Agent

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Something went wrong in Ignition!

An error occurred in Ignition's UI. Please open an issue on [the Ignition GitHub repo] and make sure to include any errors or warnings in the developer console.

Screenshot 2022-03-03 at 10 36 08

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://192.168.0.159:8001/login:52:249981)
    at mi (http://192.168.0.159:8001/login:52:70706)
    at Ql (http://192.168.0.159:8001/login:52:122308)
    at xc (http://192.168.0.159:8001/login:52:109797)
    at _c (http://192.168.0.159:8001/login:52:109725)
    at Cc (http://192.168.0.159:8001/login:52:109588)
    at Nc (http://192.168.0.159:8001/login:52:106582)
    at hc (http://192.168.0.159:8001/login:52:103958)
    at nu (http://192.168.0.159:8001/login:52:119816)
    at http://192.168.0.159:8001/login:52:121187

User Agent

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://localhost/curso14/public/:72:249981)
    at mi (http://localhost/curso14/public/:72:70706)
    at Ql (http://localhost/curso14/public/:72:122308)
    at xc (http://localhost/curso14/public/:72:109797)
    at _c (http://localhost/curso14/public/:72:109725)
    at Cc (http://localhost/curso14/public/:72:109588)
    at Nc (http://localhost/curso14/public/:72:106582)
    at hc (http://localhost/curso14/public/:72:103958)
    at nu (http://localhost/curso14/public/:72:119816)
    at http://localhost/curso14/public/:72:121187

User Agent

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36

An error page changes the current URL structure

When you get an error, your current URL is changed by adding a hash like #F50.

I suppose it is added with reason, maybe some kind of JS routing but this is annoying. Especially when you refresh the page the hash still exists, so my browser history is polluted by "hashed" URLs. Also is harder to select URLs text, modify it, etc.

But what is the worst - when you use hashes in your application and you generate an error, you lost your original URL with hash, even if you fix this error and refresh the page.

How to disable error detection for composer packages (a folder)

Hello,

I would like to know if it is possible to deactivate the detection for a folder, in my case the vendor folder and if not, propose a solution.
I was previously using symfony/error-handler and I had no problem.
Ignition gives me errors like there are some in the packages in /vendor directory when it is not the case.

Thanks in advance for your help.

Uncaught TypeError: query.bindings.map is not a function

Since a little while, Ignition doesn't show itself when an exception is triggered on a Laravel 9 project. Instead, I get the following in the console:

Uncaught TypeError: query.bindings.map is not a function
    queries https://localnova.local/make-pdf:23144
    transformIgnitionError https://localnova.local/make-pdf:23138
    ignite https://localnova.local/make-pdf:23087
    <anonymous> https://localnova.local/make-pdf:23264
[make-pdf:23144:38](https://localnova.local/make-pdf)
    queries https://localnova.local/make-pdf:23144
    map self-hosted:224
    transformIgnitionError https://localnova.local/make-pdf:23138
    ignite https://localnova.local/make-pdf:23087
    <anonymous> https://localnova.local/make-pdf:23264

In my case, the query object looks like the following:

{
  "sql": "    SELECT code, nom_departement FROM departementfr\n    WHERE id_departement = :id\n    LIMIT 1",
  "time": 13.72,
  "connection_name": "mysql-legacy",
  "bindings": {
    "id": "28"
  },
  "microtime": 1645118691.315789
}

So bindings there is an object, not an array.

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (https://gxxc.dds138.com/:72:249981)
    at mi (https://gxxc.dds138.com/:72:70706)
    at Ql (https://gxxc.dds138.com/:72:122308)
    at xc (https://gxxc.dds138.com/:72:109797)
    at _c (https://gxxc.dds138.com/:72:109725)
    at Cc (https://gxxc.dds138.com/:72:109588)
    at Nc (https://gxxc.dds138.com/:72:106582)
    at hc (https://gxxc.dds138.com/:72:103958)
    at nu (https://gxxc.dds138.com/:72:119816)
    at https://gxxc.dds138.com/:72:121187

User Agent

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36

93 errors inside DevTools console

Hi there, just tried out the package with a CMS (TYPO3) based on PHP which works like a charm - except a new exception I just ran into causes the following issue:

image

it doesn't spam my console only, but also JS (e.g. click) events are not working at all. Trying to collapse the vendor frames of the stacktrace but nothing happens.

I've shared the exception also here:
https://flareapp.io/share/17xjlVNm#share

BTW: I saw that /_ignition/update-config has a TODO comment, the README does not mention that at all, talking about non-laravel environment require a manual route handling for this to forward it to a specific controller/handler?

Thanks in advance,
Mati

TypeError: Cannot read properties of undefined (reading 'code_snippet')

TypeError: Cannot read properties of undefined (reading 'code_snippet') at zE (http://127.0.0.1:8000/:72:257091) at mi (http://127.0.0.1:8000/:72:70706) at Ql (http://127.0.0.1:8000/:72:122308) at xc (http://127.0.0.1:8000/:72:109797) at _c (http://127.0.0.1:8000/:72:109725) at Cc (http://127.0.0.1:8000/:72:109588) at Nc (http://127.0.0.1:8000/:72:106582) at hc (http://127.0.0.1:8000/:72:103958) at nu (http://127.0.0.1:8000/:72:119816) at http://127.0.0.1:8000/:72:121187

TypeError: n is undefined

Please include some context and the contents of the console in your browser's developer tools.

XE@http://localhost/shorturl/:72:249965
mi@http://localhost/shorturl/:72:70706
Ql@http://localhost/shorturl/:72:122308
xc@http://localhost/shorturl/:72:109799
_c@http://localhost/shorturl/:72:109727
Cc@http://localhost/shorturl/:72:109588
Nc@http://localhost/shorturl/:72:106582
hc@http://localhost/shorturl/:72:103958
nu@http://localhost/shorturl/:72:119816
cu/<@http://localhost/shorturl/:72:121189
Oc@http://localhost/shorturl/:72:106960
cu@http://localhost/shorturl/:72:121175
render@http://localhost/shorturl/:72:128583
window.ignite@http://localhost/shorturl/:72:496817
@http://localhost/shorturl/:76:12

User Agent

Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://159.223.172.169/:72:249981)
    at mi (http://159.223.172.169/:72:70706)
    at Ql (http://159.223.172.169/:72:122308)
    at xc (http://159.223.172.169/:72:109797)
    at _c (http://159.223.172.169/:72:109725)
    at Cc (http://159.223.172.169/:72:109588)
    at Nc (http://159.223.172.169/:72:106582)
    at hc (http://159.223.172.169/:72:103958)
    at nu (http://159.223.172.169/:72:119816)
    at http://159.223.172.169/:72:121187

User Agent

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36

Ignition v3 to-do's

Front-end issues

  • Safari build is broken (regex in TailwindCSS build)
  • Tag pre-release versions
  • Show full context key on hover
  • Figure out solution contracts in Ignition v3
  • Readme
  • Error boundaries
  • Share admin URLs
  • Error message when failed to save settings
  • Remove Laravel docs in PHP agnostic version
  • Figure out ignition-ui release on NPM
  • Switch back to HighlightJS (only one with Blade support)
  • Export SQL queries from exception in ErrorCard
  • Hide sections that have no content
  • Highlighted stack frames should be cached when switching frames
  • Livewire context needs to be ported
  • Active indicator for context
  • Syntax highlighting for CURL & SQL CodeSnippets
  • Debug section should disappear if there are no debug items
  • Link to Telescope is missing
  • Clicking outside of share/settings dialog should close the dialog
  • Add extra information to settings dialog about saving to ~/.ignition.json
  • Fix docs link
  • Refactor data models in all packages
  • Make sure the first active frame is always an application frame
  • Stack frames without a classname should show filename
  • ShikiJS local, no external dependencies (or Prism/Highlightjs)
  • Ignore full path prefix option for RelaxedFilePath component (/users/alex/projects/sail/index.php -> index.php)
  • Remove ๐Ÿงจ
  • Test PHP view exceptions (so not blade)
  • Docs site in share popup
  • Remove exception class dropdown

Layout/design issues

  • Debug section styling
  • Symfony dumps additional styling (e.g. search input & darkmode)
  • Icons: preferable bundled as SVGs. Definitely needs to be local
  • Livewire icon
  • "Settings saved" after saving settings should be styled
  • Git context styling
  • View data layout (key-value data in een DefinitionList.Row)
  • DefinitionList.Row boolean value styling (currently weirdly spaced icons)
  • Min-height for stacktrace (gets small when there's just a couple of lines of code)
  • Multi-column layout?
  • Click outside Share/Settings closes dropdown
  • Clickable context menu
  • Anchor offset
  • Solution runner styling
  • Can't click on the lower half of debug tabs

Back-end/PHP issues

  • User's local dotfile settings get overwritten by project settings
  • Modify Flare API to accept shares with just 3 context options
  • PR namespace change to Livewire
  • Custom blade engine revision: do we still need it if we don't log view data?

Maybe later

  • Show call parameters in every frame
  • Support previous exceptions
  • Make expanded CodeSnippet collapsable again?
  • Look into alternatives for share admin URL?
  • Keep code colors consistent between SFdumps and highlight.js

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://localhost/:72:249981)
    at mi (http://localhost/:72:70706)
    at Ql (http://localhost/:72:122308)
    at xc (http://localhost/:72:109797)
    at _c (http://localhost/:72:109725)
    at Cc (http://localhost/:72:109588)
    at Nc (http://localhost/:72:106582)
    at hc (http://localhost/:72:103958)
    at nu (http://localhost/:72:119816)
    at http://localhost/:72:121187

User Agent

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://54.88.176.158/:72:249981)
    at mi (http://54.88.176.158/:72:70706)
    at Ql (http://54.88.176.158/:72:122308)
    at xc (http://54.88.176.158/:72:109797)
    at _c (http://54.88.176.158/:72:109725)
    at Cc (http://54.88.176.158/:72:109588)
    at Nc (http://54.88.176.158/:72:106582)
    at hc (http://54.88.176.158/:72:103958)
    at nu (http://54.88.176.158/:72:119816)
    at http://54.88.176.158/:72:121187

User Agent

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36

TypeError: n is undefined

zE@http://127.0.0.1:8000/:72:257075mi@http://127.0.0.1:8000/:72:70706Ql@http://127.0.0.1:8000/:72:122308xc@http://127.0.0.1:8000/:72:109799_c@http://127.0.0.1:8000/:72:109727Cc@http://127.0.0.1:8000/:72:109588Nc@http://127.0.0.1:8000/:72:106582hc@http://127.0.0.1:8000/:72:103958nu@http://127.0.0.1:8000/:72:119816cu/<@http://127.0.0.1:8000/:72:121189Oc@http://127.0.0.1:8000/:72:106960cu@http://127.0.0.1:8000/:72:121175render@http://127.0.0.1:8000/:72:128583window.ignite@http://127.0.0.1:8000/:72:508564@http://127.0.0.1:8000/:76:12

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://localhost:2015/:72:249981)
    at mi (http://localhost:2015/:72:70706)
    at Ql (http://localhost:2015/:72:122308)
    at xc (http://localhost:2015/:72:109797)
    at _c (http://localhost:2015/:72:109725)
    at Cc (http://localhost:2015/:72:109588)
    at Nc (http://localhost:2015/:72:106582)
    at hc (http://localhost:2015/:72:103958)
    at nu (http://localhost:2015/:72:119816)
    at http://localhost:2015/:72:121187

User Agent

Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Mobile Safari/537.36

Object Report

{
    "report": {
        "notifier": "Laravel Client",
        "language": "PHP",
        "framework_version": "9.3.0",
        "language_version": "8.1.3",
        "exception_class": "UnexpectedValueException",
        "seen_at": 1646248294,
        "message": "The stream or file \"/home/coco/Projects/loco/storage/logs/laravel.log\" could not be opened in append mode: Failed to open stream: Permission denied",
        "glows": [],
        "solutions": [],
        "documentation_links": [],
        "stacktrace": [
            {
                "file": "/home/coco/Projects/loco/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php",
                "line_number": 146,
                "method": "write",
                "class": "Monolog\\Handler\\StreamHandler",
                "code_snippet": {
                    "131": "            $url = $this->url;",
                    "132": "            if (null === $url || '' === $url) {",
                    "133": "                throw new \\LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().');",
                    "134": "            }",
                    "135": "            $this->createDir($url);",
                    "136": "            $this->errorMessage = null;",
                    "137": "            set_error_handler([$this, 'customErrorHandler']);",
                    "138": "            $stream = fopen($url, 'a');",
                    "139": "            if ($this->filePermission !== null) {",
                    "140": "                @chmod($url, $this->filePermission);",
                    "141": "            }",
                    "142": "            restore_error_handler();",
                    "143": "            if (!is_resource($stream)) {",
                    "144": "                $this->stream = null;",
                    "145": "",
                    "146": "                throw new \\UnexpectedValueException(sprintf('The stream or file \"%s\" could not be opened in append mode: '.$this->errorMessage, $url));",
                    "147": "            }",
                    "148": "            stream_set_chunk_size($stream, $this->streamChunkSize);",
                    "149": "            $this->stream = $stream;",
                    "150": "        }",
                    "151": "",
                    "152": "        $stream = $this->stream;",
                    "153": "        if (!is_resource($stream)) {",
                    "154": "            throw new \\LogicException('No stream was opened yet');",
                    "155": "        }",
                    "156": "",
                    "157": "        if ($this->useLocking) {",
                    "158": "            // ignoring errors here, there's not much we can do about them",
                    "159": "            flock($stream, LOCK_EX);",
                    "160": "        }"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php",
                "line_number": 48,
                "method": "handle",
                "class": "Monolog\\Handler\\AbstractProcessingHandler",
                "code_snippet": {
                    "33": "     * {@inheritDoc}",
                    "34": "     */",
                    "35": "    public function handle(array $record): bool",
                    "36": "    {",
                    "37": "        if (!$this->isHandling($record)) {",
                    "38": "            return false;",
                    "39": "        }",
                    "40": "",
                    "41": "        if ($this->processors) {",
                    "42": "            /** @var Record $record */",
                    "43": "            $record = $this->processRecord($record);",
                    "44": "        }",
                    "45": "",
                    "46": "        $record['formatted'] = $this->getFormatter()->format($record);",
                    "47": "",
                    "48": "        $this->write($record);",
                    "49": "",
                    "50": "        return false === $this->bubble;",
                    "51": "    }",
                    "52": "",
                    "53": "    /**",
                    "54": "     * Writes the record down to the log of the implementing handler",
                    "55": "     *",
                    "56": "     * @phpstan-param FormattedRecord $record",
                    "57": "     */",
                    "58": "    abstract protected function write(array $record): void;",
                    "59": "",
                    "60": "    /**",
                    "61": "     * @return void",
                    "62": "     */"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/monolog/monolog/src/Monolog/Logger.php",
                "line_number": 327,
                "method": "addRecord",
                "class": "Monolog\\Logger",
                "code_snippet": {
                    "312": "                ];",
                    "313": "",
                    "314": "                try {",
                    "315": "                    foreach ($this->processors as $processor) {",
                    "316": "                        $record = $processor($record);",
                    "317": "                    }",
                    "318": "                } catch (Throwable $e) {",
                    "319": "                    $this->handleException($e, $record);",
                    "320": "",
                    "321": "                    return true;",
                    "322": "                }",
                    "323": "            }",
                    "324": "",
                    "325": "            // once the record exists, send it to all handlers as long as the bubbling chain is not interrupted",
                    "326": "            try {",
                    "327": "                if (true === $handler->handle($record)) {",
                    "328": "                    break;",
                    "329": "                }",
                    "330": "            } catch (Throwable $e) {",
                    "331": "                $this->handleException($e, $record);",
                    "332": "",
                    "333": "                return true;",
                    "334": "            }",
                    "335": "        }",
                    "336": "",
                    "337": "        return null !== $record;",
                    "338": "    }",
                    "339": "",
                    "340": "    /**",
                    "341": "     * Ends a log cycle and frees all resources used by handlers."
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/monolog/monolog/src/Monolog/Logger.php",
                "line_number": 565,
                "method": "error",
                "class": "Monolog\\Logger",
                "code_snippet": {
                    "550": "    public function warning($message, array $context = []): void",
                    "551": "    {",
                    "552": "        $this->addRecord(static::WARNING, (string) $message, $context);",
                    "553": "    }",
                    "554": "",
                    "555": "    /**",
                    "556": "     * Adds a log record at the ERROR level.",
                    "557": "     *",
                    "558": "     * This method allows for compatibility with common interfaces.",
                    "559": "     *",
                    "560": "     * @param string|Stringable $message The log message",
                    "561": "     * @param mixed[]           $context The log context",
                    "562": "     */",
                    "563": "    public function error($message, array $context = []): void",
                    "564": "    {",
                    "565": "        $this->addRecord(static::ERROR, (string) $message, $context);",
                    "566": "    }",
                    "567": "",
                    "568": "    /**",
                    "569": "     * Adds a log record at the CRITICAL level.",
                    "570": "     *",
                    "571": "     * This method allows for compatibility with common interfaces.",
                    "572": "     *",
                    "573": "     * @param string|Stringable $message The log message",
                    "574": "     * @param mixed[]           $context The log context",
                    "575": "     */",
                    "576": "    public function critical($message, array $context = []): void",
                    "577": "    {",
                    "578": "        $this->addRecord(static::CRITICAL, (string) $message, $context);",
                    "579": "    }"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/laravel/framework/src/Illuminate/Log/Logger.php",
                "line_number": 183,
                "method": "writeLog",
                "class": "Illuminate\\Log\\Logger",
                "code_snippet": {
                    "168": "        $this->writeLog($level, $message, $context);",
                    "169": "    }",
                    "170": "",
                    "171": "    /**",
                    "172": "     * Write a message to the log.",
                    "173": "     *",
                    "174": "     * @param  string  $level",
                    "175": "     * @param  \\Illuminate\\Contracts\\Support\\Arrayable|\\Illuminate\\Contracts\\Support\\Jsonable|\\Illuminate\\Support\\Stringable|array|string  $message",
                    "176": "     * @param  array  $context",
                    "177": "     * @return void",
                    "178": "     */",
                    "179": "    protected function writeLog($level, $message, $context): void",
                    "180": "    {",
                    "181": "        $this->logger->{$level}(",
                    "182": "            $message = $this->formatMessage($message),",
                    "183": "            $context = array_merge($this->context, $context)",
                    "184": "        );",
                    "185": "",
                    "186": "        $this->fireLogEvent($level, $message, $context);",
                    "187": "    }",
                    "188": "",
                    "189": "    /**",
                    "190": "     * Add context to all future logs.",
                    "191": "     *",
                    "192": "     * @param  array  $context",
                    "193": "     * @return $this",
                    "194": "     */",
                    "195": "    public function withContext(array $context = [])",
                    "196": "    {",
                    "197": "        $this->context = array_merge($this->context, $context);"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/laravel/framework/src/Illuminate/Log/Logger.php",
                "line_number": 94,
                "method": "error",
                "class": "Illuminate\\Log\\Logger",
                "code_snippet": {
                    "79": "     */",
                    "80": "    public function critical($message, array $context = []): void",
                    "81": "    {",
                    "82": "        $this->writeLog(__FUNCTION__, $message, $context);",
                    "83": "    }",
                    "84": "",
                    "85": "    /**",
                    "86": "     * Log an error message to the logs.",
                    "87": "     *",
                    "88": "     * @param  \\Illuminate\\Contracts\\Support\\Arrayable|\\Illuminate\\Contracts\\Support\\Jsonable|\\Illuminate\\Support\\Stringable|array|string  $message",
                    "89": "     * @param  array  $context",
                    "90": "     * @return void",
                    "91": "     */",
                    "92": "    public function error($message, array $context = []): void",
                    "93": "    {",
                    "94": "        $this->writeLog(__FUNCTION__, $message, $context);",
                    "95": "    }",
                    "96": "",
                    "97": "    /**",
                    "98": "     * Log a warning message to the logs.",
                    "99": "     *",
                    "100": "     * @param  \\Illuminate\\Contracts\\Support\\Arrayable|\\Illuminate\\Contracts\\Support\\Jsonable|\\Illuminate\\Support\\Stringable|array|string  $message",
                    "101": "     * @param  array  $context",
                    "102": "     * @return void",
                    "103": "     */",
                    "104": "    public function warning($message, array $context = []): void",
                    "105": "    {",
                    "106": "        $this->writeLog(__FUNCTION__, $message, $context);",
                    "107": "    }",
                    "108": ""
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/laravel/framework/src/Illuminate/Log/LogManager.php",
                "line_number": 590,
                "method": "error",
                "class": "Illuminate\\Log\\LogManager",
                "code_snippet": {
                    "575": "    public function critical($message, array $context = []): void",
                    "576": "    {",
                    "577": "        $this->driver()->critical($message, $context);",
                    "578": "    }",
                    "579": "",
                    "580": "    /**",
                    "581": "     * Runtime errors that do not require immediate action but should typically",
                    "582": "     * be logged and monitored.",
                    "583": "     *",
                    "584": "     * @param  string  $message",
                    "585": "     * @param  array  $context",
                    "586": "     * @return void",
                    "587": "     */",
                    "588": "    public function error($message, array $context = []): void",
                    "589": "    {",
                    "590": "        $this->driver()->error($message, $context);",
                    "591": "    }",
                    "592": "",
                    "593": "    /**",
                    "594": "     * Exceptional occurrences that are not errors.",
                    "595": "     *",
                    "596": "     * Example: Use of deprecated APIs, poor use of an API, undesirable things",
                    "597": "     * that are not necessarily wrong.",
                    "598": "     *",
                    "599": "     * @param  string  $message",
                    "600": "     * @param  array  $context",
                    "601": "     * @return void",
                    "602": "     */",
                    "603": "    public function warning($message, array $context = []): void",
                    "604": "    {"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php",
                "line_number": 249,
                "method": "report",
                "class": "Illuminate\\Foundation\\Exceptions\\Handler",
                "code_snippet": {
                    "234": "                return;",
                    "235": "            }",
                    "236": "        }",
                    "237": "",
                    "238": "        try {",
                    "239": "            $logger = $this->container->make(LoggerInterface::class);",
                    "240": "        } catch (Exception $ex) {",
                    "241": "            throw $e;",
                    "242": "        }",
                    "243": "",
                    "244": "        $logger->error(",
                    "245": "            $e->getMessage(),",
                    "246": "            array_merge(",
                    "247": "                $this->exceptionContext($e),",
                    "248": "                $this->context(),",
                    "249": "                ['exception' => $e]",
                    "250": "            )",
                    "251": "        );",
                    "252": "    }",
                    "253": "",
                    "254": "    /**",
                    "255": "     * Determine if the exception should be reported.",
                    "256": "     *",
                    "257": "     * @param  \\Throwable  $e",
                    "258": "     * @return bool",
                    "259": "     */",
                    "260": "    public function shouldReport(Throwable $e)",
                    "261": "    {",
                    "262": "        return ! $this->shouldntReport($e);",
                    "263": "    }"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php",
                "line_number": 165,
                "method": "handleException",
                "class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions",
                "code_snippet": {
                    "150": "    /**",
                    "151": "     * Handle an uncaught exception from the application.",
                    "152": "     *",
                    "153": "     * Note: Most exceptions can be handled via the try / catch block in",
                    "154": "     * the HTTP and Console kernels. But, fatal error exceptions must",
                    "155": "     * be handled differently since they are not normal exceptions.",
                    "156": "     *",
                    "157": "     * @param  \\Throwable  $e",
                    "158": "     * @return void",
                    "159": "     */",
                    "160": "    public function handleException(Throwable $e)",
                    "161": "    {",
                    "162": "        try {",
                    "163": "            self::$reservedMemory = null;",
                    "164": "",
                    "165": "            $this->getExceptionHandler()->report($e);",
                    "166": "        } catch (Exception $e) {",
                    "167": "            //",
                    "168": "        }",
                    "169": "",
                    "170": "        if (static::$app->runningInConsole()) {",
                    "171": "            $this->renderForConsole($e);",
                    "172": "        } else {",
                    "173": "            $this->renderHttpResponse($e);",
                    "174": "        }",
                    "175": "    }",
                    "176": "",
                    "177": "    /**",
                    "178": "     * Render an exception to the console.",
                    "179": "     *"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php",
                "line_number": 231,
                "method": "Illuminate\\Foundation\\Bootstrap\\{closure}",
                "class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions",
                "code_snippet": {
                    "216": "     * @return \\Symfony\\Component\\ErrorHandler\\Error\\FatalError",
                    "217": "     */",
                    "218": "    protected function fatalErrorFromPhpError(array $error, $traceOffset = null)",
                    "219": "    {",
                    "220": "        return new FatalError($error['message'], 0, $error, $traceOffset);",
                    "221": "    }",
                    "222": "",
                    "223": "    /**",
                    "224": "     * Forward a method call to the given method if an application instance exists.",
                    "225": "     *",
                    "226": "     * @return callable",
                    "227": "     */",
                    "228": "    protected function forwardsTo($method)",
                    "229": "    {",
                    "230": "        return fn (...$arguments) => static::$app",
                    "231": "            ? $this->{$method}(...$arguments)",
                    "232": "            : false;",
                    "233": "    }",
                    "234": "",
                    "235": "    /**",
                    "236": "     * Determine if the error level is a deprecation.",
                    "237": "     *",
                    "238": "     * @param  int  $level",
                    "239": "     * @return bool",
                    "240": "     */",
                    "241": "    protected function isDeprecation($level)",
                    "242": "    {",
                    "243": "        return in_array($level, [E_DEPRECATED, E_USER_DEPRECATED]);",
                    "244": "    }",
                    "245": ""
                },
                "application_frame": false
            },
            {
                "file": "unknown",
                "line_number": 0,
                "method": "[top]",
                "class": null,
                "code_snippet": [],
                "application_frame": false
            }
        ],
        "context": {
            "request": {
                "url": "http://localhost:2015/",
                "ip": null,
                "method": "GET",
                "useragent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36"
            },
            "request_data": {
                "queryString": [],
                "body": [],
                "files": []
            },
            "headers": {
                "accept-language": [
                    "en-US,en;q=0.9"
                ],
                "sec-fetch-user": [
                    "?1"
                ],
                "sec-fetch-mode": [
                    "navigate"
                ],
                "cache-control": [
                    "max-age=0"
                ],
                "x-forwarded-for": [
                    "::1"
                ],
                "x-forwarded-proto": [
                    "http"
                ],
                "user-agent": [
                    "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36"
                ],
                "host": [
                    "localhost:2015"
                ],
                "content-length": [
                    "0"
                ],
                "sec-ch-ua-mobile": [
                    "?0"
                ],
                "accept-encoding": [
                    "gzip, deflate, br"
                ],
                "dnt": [
                    "1"
                ],
                "content-type": [
                    ""
                ],
                "sec-ch-ua-platform": [
                    "\"Linux\""
                ],
                "sec-fetch-dest": [
                    "document"
                ],
                "sec-fetch-site": [
                    "none"
                ],
                "sec-ch-ua": [
                    "\"Chromium\";v=\"95\", \";Not A Brand\";v=\"99\""
                ],
                "accept": [
                    "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
                ],
                "upgrade-insecure-requests": [
                    "1"
                ]
            },
            "cookies": [],
            "session": {
                "_token": "irbV1SdVq3Ws3uAaeMYaq6aesXHazZvDi2Ipcs0p"
            },
            "route": {
                "route": null,
                "routeParameters": [],
                "controllerAction": "Closure",
                "middleware": [
                    "web"
                ]
            },
            "env": {
                "laravel_version": "9.3.0",
                "laravel_locale": "en",
                "laravel_config_cached": false,
                "app_debug": true,
                "app_env": "local",
                "php_version": "8.1.3"
            },
            "dumps": [],
            "logs": [],
            "queries": []
        },
        "stage": "local",
        "message_level": null,
        "open_frame_index": null,
        "application_path": "/home/coco/Projects/loco",
        "application_version": null,
        "tracking_uuid": "55b2ba9f-f601-40fb-8cd7-7a270ec42f0c"
    },
    "shareableReport": {
        "notifier": "Laravel Client",
        "language": "PHP",
        "framework_version": "9.3.0",
        "language_version": "8.1.3",
        "exception_class": "UnexpectedValueException",
        "seen_at": 1646248294,
        "message": "The stream or file \"/home/coco/Projects/loco/storage/logs/laravel.log\" could not be opened in append mode: Failed to open stream: Permission denied",
        "glows": [],
        "solutions": [],
        "documentation_links": [],
        "stacktrace": [
            {
                "file": "/home/coco/Projects/loco/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php",
                "line_number": 146,
                "method": "write",
                "class": "Monolog\\Handler\\StreamHandler",
                "code_snippet": {
                    "131": "            $url = $this->url;",
                    "132": "            if (null === $url || '' === $url) {",
                    "133": "                throw new \\LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().');",
                    "134": "            }",
                    "135": "            $this->createDir($url);",
                    "136": "            $this->errorMessage = null;",
                    "137": "            set_error_handler([$this, 'customErrorHandler']);",
                    "138": "            $stream = fopen($url, 'a');",
                    "139": "            if ($this->filePermission !== null) {",
                    "140": "                @chmod($url, $this->filePermission);",
                    "141": "            }",
                    "142": "            restore_error_handler();",
                    "143": "            if (!is_resource($stream)) {",
                    "144": "                $this->stream = null;",
                    "145": "",
                    "146": "                throw new \\UnexpectedValueException(sprintf('The stream or file \"%s\" could not be opened in append mode: '.$this->errorMessage, $url));",
                    "147": "            }",
                    "148": "            stream_set_chunk_size($stream, $this->streamChunkSize);",
                    "149": "            $this->stream = $stream;",
                    "150": "        }",
                    "151": "",
                    "152": "        $stream = $this->stream;",
                    "153": "        if (!is_resource($stream)) {",
                    "154": "            throw new \\LogicException('No stream was opened yet');",
                    "155": "        }",
                    "156": "",
                    "157": "        if ($this->useLocking) {",
                    "158": "            // ignoring errors here, there's not much we can do about them",
                    "159": "            flock($stream, LOCK_EX);",
                    "160": "        }"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php",
                "line_number": 48,
                "method": "handle",
                "class": "Monolog\\Handler\\AbstractProcessingHandler",
                "code_snippet": {
                    "33": "     * {@inheritDoc}",
                    "34": "     */",
                    "35": "    public function handle(array $record): bool",
                    "36": "    {",
                    "37": "        if (!$this->isHandling($record)) {",
                    "38": "            return false;",
                    "39": "        }",
                    "40": "",
                    "41": "        if ($this->processors) {",
                    "42": "            /** @var Record $record */",
                    "43": "            $record = $this->processRecord($record);",
                    "44": "        }",
                    "45": "",
                    "46": "        $record['formatted'] = $this->getFormatter()->format($record);",
                    "47": "",
                    "48": "        $this->write($record);",
                    "49": "",
                    "50": "        return false === $this->bubble;",
                    "51": "    }",
                    "52": "",
                    "53": "    /**",
                    "54": "     * Writes the record down to the log of the implementing handler",
                    "55": "     *",
                    "56": "     * @phpstan-param FormattedRecord $record",
                    "57": "     */",
                    "58": "    abstract protected function write(array $record): void;",
                    "59": "",
                    "60": "    /**",
                    "61": "     * @return void",
                    "62": "     */"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/monolog/monolog/src/Monolog/Logger.php",
                "line_number": 327,
                "method": "addRecord",
                "class": "Monolog\\Logger",
                "code_snippet": {
                    "312": "                ];",
                    "313": "",
                    "314": "                try {",
                    "315": "                    foreach ($this->processors as $processor) {",
                    "316": "                        $record = $processor($record);",
                    "317": "                    }",
                    "318": "                } catch (Throwable $e) {",
                    "319": "                    $this->handleException($e, $record);",
                    "320": "",
                    "321": "                    return true;",
                    "322": "                }",
                    "323": "            }",
                    "324": "",
                    "325": "            // once the record exists, send it to all handlers as long as the bubbling chain is not interrupted",
                    "326": "            try {",
                    "327": "                if (true === $handler->handle($record)) {",
                    "328": "                    break;",
                    "329": "                }",
                    "330": "            } catch (Throwable $e) {",
                    "331": "                $this->handleException($e, $record);",
                    "332": "",
                    "333": "                return true;",
                    "334": "            }",
                    "335": "        }",
                    "336": "",
                    "337": "        return null !== $record;",
                    "338": "    }",
                    "339": "",
                    "340": "    /**",
                    "341": "     * Ends a log cycle and frees all resources used by handlers."
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/monolog/monolog/src/Monolog/Logger.php",
                "line_number": 565,
                "method": "error",
                "class": "Monolog\\Logger",
                "code_snippet": {
                    "550": "    public function warning($message, array $context = []): void",
                    "551": "    {",
                    "552": "        $this->addRecord(static::WARNING, (string) $message, $context);",
                    "553": "    }",
                    "554": "",
                    "555": "    /**",
                    "556": "     * Adds a log record at the ERROR level.",
                    "557": "     *",
                    "558": "     * This method allows for compatibility with common interfaces.",
                    "559": "     *",
                    "560": "     * @param string|Stringable $message The log message",
                    "561": "     * @param mixed[]           $context The log context",
                    "562": "     */",
                    "563": "    public function error($message, array $context = []): void",
                    "564": "    {",
                    "565": "        $this->addRecord(static::ERROR, (string) $message, $context);",
                    "566": "    }",
                    "567": "",
                    "568": "    /**",
                    "569": "     * Adds a log record at the CRITICAL level.",
                    "570": "     *",
                    "571": "     * This method allows for compatibility with common interfaces.",
                    "572": "     *",
                    "573": "     * @param string|Stringable $message The log message",
                    "574": "     * @param mixed[]           $context The log context",
                    "575": "     */",
                    "576": "    public function critical($message, array $context = []): void",
                    "577": "    {",
                    "578": "        $this->addRecord(static::CRITICAL, (string) $message, $context);",
                    "579": "    }"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/laravel/framework/src/Illuminate/Log/Logger.php",
                "line_number": 183,
                "method": "writeLog",
                "class": "Illuminate\\Log\\Logger",
                "code_snippet": {
                    "168": "        $this->writeLog($level, $message, $context);",
                    "169": "    }",
                    "170": "",
                    "171": "    /**",
                    "172": "     * Write a message to the log.",
                    "173": "     *",
                    "174": "     * @param  string  $level",
                    "175": "     * @param  \\Illuminate\\Contracts\\Support\\Arrayable|\\Illuminate\\Contracts\\Support\\Jsonable|\\Illuminate\\Support\\Stringable|array|string  $message",
                    "176": "     * @param  array  $context",
                    "177": "     * @return void",
                    "178": "     */",
                    "179": "    protected function writeLog($level, $message, $context): void",
                    "180": "    {",
                    "181": "        $this->logger->{$level}(",
                    "182": "            $message = $this->formatMessage($message),",
                    "183": "            $context = array_merge($this->context, $context)",
                    "184": "        );",
                    "185": "",
                    "186": "        $this->fireLogEvent($level, $message, $context);",
                    "187": "    }",
                    "188": "",
                    "189": "    /**",
                    "190": "     * Add context to all future logs.",
                    "191": "     *",
                    "192": "     * @param  array  $context",
                    "193": "     * @return $this",
                    "194": "     */",
                    "195": "    public function withContext(array $context = [])",
                    "196": "    {",
                    "197": "        $this->context = array_merge($this->context, $context);"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/laravel/framework/src/Illuminate/Log/Logger.php",
                "line_number": 94,
                "method": "error",
                "class": "Illuminate\\Log\\Logger",
                "code_snippet": {
                    "79": "     */",
                    "80": "    public function critical($message, array $context = []): void",
                    "81": "    {",
                    "82": "        $this->writeLog(__FUNCTION__, $message, $context);",
                    "83": "    }",
                    "84": "",
                    "85": "    /**",
                    "86": "     * Log an error message to the logs.",
                    "87": "     *",
                    "88": "     * @param  \\Illuminate\\Contracts\\Support\\Arrayable|\\Illuminate\\Contracts\\Support\\Jsonable|\\Illuminate\\Support\\Stringable|array|string  $message",
                    "89": "     * @param  array  $context",
                    "90": "     * @return void",
                    "91": "     */",
                    "92": "    public function error($message, array $context = []): void",
                    "93": "    {",
                    "94": "        $this->writeLog(__FUNCTION__, $message, $context);",
                    "95": "    }",
                    "96": "",
                    "97": "    /**",
                    "98": "     * Log a warning message to the logs.",
                    "99": "     *",
                    "100": "     * @param  \\Illuminate\\Contracts\\Support\\Arrayable|\\Illuminate\\Contracts\\Support\\Jsonable|\\Illuminate\\Support\\Stringable|array|string  $message",
                    "101": "     * @param  array  $context",
                    "102": "     * @return void",
                    "103": "     */",
                    "104": "    public function warning($message, array $context = []): void",
                    "105": "    {",
                    "106": "        $this->writeLog(__FUNCTION__, $message, $context);",
                    "107": "    }",
                    "108": ""
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/laravel/framework/src/Illuminate/Log/LogManager.php",
                "line_number": 590,
                "method": "error",
                "class": "Illuminate\\Log\\LogManager",
                "code_snippet": {
                    "575": "    public function critical($message, array $context = []): void",
                    "576": "    {",
                    "577": "        $this->driver()->critical($message, $context);",
                    "578": "    }",
                    "579": "",
                    "580": "    /**",
                    "581": "     * Runtime errors that do not require immediate action but should typically",
                    "582": "     * be logged and monitored.",
                    "583": "     *",
                    "584": "     * @param  string  $message",
                    "585": "     * @param  array  $context",
                    "586": "     * @return void",
                    "587": "     */",
                    "588": "    public function error($message, array $context = []): void",
                    "589": "    {",
                    "590": "        $this->driver()->error($message, $context);",
                    "591": "    }",
                    "592": "",
                    "593": "    /**",
                    "594": "     * Exceptional occurrences that are not errors.",
                    "595": "     *",
                    "596": "     * Example: Use of deprecated APIs, poor use of an API, undesirable things",
                    "597": "     * that are not necessarily wrong.",
                    "598": "     *",
                    "599": "     * @param  string  $message",
                    "600": "     * @param  array  $context",
                    "601": "     * @return void",
                    "602": "     */",
                    "603": "    public function warning($message, array $context = []): void",
                    "604": "    {"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php",
                "line_number": 249,
                "method": "report",
                "class": "Illuminate\\Foundation\\Exceptions\\Handler",
                "code_snippet": {
                    "234": "                return;",
                    "235": "            }",
                    "236": "        }",
                    "237": "",
                    "238": "        try {",
                    "239": "            $logger = $this->container->make(LoggerInterface::class);",
                    "240": "        } catch (Exception $ex) {",
                    "241": "            throw $e;",
                    "242": "        }",
                    "243": "",
                    "244": "        $logger->error(",
                    "245": "            $e->getMessage(),",
                    "246": "            array_merge(",
                    "247": "                $this->exceptionContext($e),",
                    "248": "                $this->context(),",
                    "249": "                ['exception' => $e]",
                    "250": "            )",
                    "251": "        );",
                    "252": "    }",
                    "253": "",
                    "254": "    /**",
                    "255": "     * Determine if the exception should be reported.",
                    "256": "     *",
                    "257": "     * @param  \\Throwable  $e",
                    "258": "     * @return bool",
                    "259": "     */",
                    "260": "    public function shouldReport(Throwable $e)",
                    "261": "    {",
                    "262": "        return ! $this->shouldntReport($e);",
                    "263": "    }"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php",
                "line_number": 165,
                "method": "handleException",
                "class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions",
                "code_snippet": {
                    "150": "    /**",
                    "151": "     * Handle an uncaught exception from the application.",
                    "152": "     *",
                    "153": "     * Note: Most exceptions can be handled via the try / catch block in",
                    "154": "     * the HTTP and Console kernels. But, fatal error exceptions must",
                    "155": "     * be handled differently since they are not normal exceptions.",
                    "156": "     *",
                    "157": "     * @param  \\Throwable  $e",
                    "158": "     * @return void",
                    "159": "     */",
                    "160": "    public function handleException(Throwable $e)",
                    "161": "    {",
                    "162": "        try {",
                    "163": "            self::$reservedMemory = null;",
                    "164": "",
                    "165": "            $this->getExceptionHandler()->report($e);",
                    "166": "        } catch (Exception $e) {",
                    "167": "            //",
                    "168": "        }",
                    "169": "",
                    "170": "        if (static::$app->runningInConsole()) {",
                    "171": "            $this->renderForConsole($e);",
                    "172": "        } else {",
                    "173": "            $this->renderHttpResponse($e);",
                    "174": "        }",
                    "175": "    }",
                    "176": "",
                    "177": "    /**",
                    "178": "     * Render an exception to the console.",
                    "179": "     *"
                },
                "application_frame": false
            },
            {
                "file": "/home/coco/Projects/loco/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php",
                "line_number": 231,
                "method": "Illuminate\\Foundation\\Bootstrap\\{closure}",
                "class": "Illuminate\\Foundation\\Bootstrap\\HandleExceptions",
                "code_snippet": {
                    "216": "     * @return \\Symfony\\Component\\ErrorHandler\\Error\\FatalError",
                    "217": "     */",
                    "218": "    protected function fatalErrorFromPhpError(array $error, $traceOffset = null)",
                    "219": "    {",
                    "220": "        return new FatalError($error['message'], 0, $error, $traceOffset);",
                    "221": "    }",
                    "222": "",
                    "223": "    /**",
                    "224": "     * Forward a method call to the given method if an application instance exists.",
                    "225": "     *",
                    "226": "     * @return callable",
                    "227": "     */",
                    "228": "    protected function forwardsTo($method)",
                    "229": "    {",
                    "230": "        return fn (...$arguments) => static::$app",
                    "231": "            ? $this->{$method}(...$arguments)",
                    "232": "            : false;",
                    "233": "    }",
                    "234": "",
                    "235": "    /**",
                    "236": "     * Determine if the error level is a deprecation.",
                    "237": "     *",
                    "238": "     * @param  int  $level",
                    "239": "     * @return bool",
                    "240": "     */",
                    "241": "    protected function isDeprecation($level)",
                    "242": "    {",
                    "243": "        return in_array($level, [E_DEPRECATED, E_USER_DEPRECATED]);",
                    "244": "    }",
                    "245": ""
                },
                "application_frame": false
            },
            {
                "file": "unknown",
                "line_number": 0,
                "method": "[top]",
                "class": null,
                "code_snippet": [],
                "application_frame": false
            }
        ],
        "context": {
            "request": {
                "url": "http://localhost:2015/",
                "ip": null,
                "method": "GET",
                "useragent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36"
            },
            "request_data": {
                "queryString": [],
                "body": [],
                "files": []
            },
            "headers": {
                "accept-language": [
                    "en-US,en;q=0.9"
                ],
                "sec-fetch-user": [
                    "?1"
                ],
                "sec-fetch-mode": [
                    "navigate"
                ],
                "cache-control": [
                    "max-age=0"
                ],
                "x-forwarded-for": [
                    "::1"
                ],
                "x-forwarded-proto": [
                    "http"
                ],
                "user-agent": [
                    "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36"
                ],
                "host": [
                    "localhost:2015"
                ],
                "content-length": [
                    "0"
                ],
                "sec-ch-ua-mobile": [
                    "?0"
                ],
                "accept-encoding": [
                    "gzip, deflate, br"
                ],
                "dnt": [
                    "1"
                ],
                "content-type": [
                    ""
                ],
                "sec-ch-ua-platform": [
                    "\"Linux\""
                ],
                "sec-fetch-dest": [
                    "document"
                ],
                "sec-fetch-site": [
                    "none"
                ],
                "sec-ch-ua": [
                    "\"Chromium\";v=\"95\", \";Not A Brand\";v=\"99\""
                ],
                "accept": [
                    "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
                ],
                "upgrade-insecure-requests": [
                    "1"
                ]
            },
            "cookies": [],
            "session": {
                "_token": "irbV1SdVq3Ws3uAaeMYaq6aesXHazZvDi2Ipcs0p"
            },
            "route": {
                "route": null,
                "routeParameters": [],
                "controllerAction": "Closure",
                "middleware": [
                    "web"
                ]
            },
            "env": {
                "laravel_version": "9.3.0",
                "laravel_locale": "en",
                "laravel_config_cached": false,
                "app_debug": true,
                "app_env": "local",
                "php_version": "8.1.3"
            },
            "dumps": [],
            "logs": [],
            "queries": []
        },
        "stage": "local",
        "message_level": null,
        "open_frame_index": null,
        "application_path": "/home/coco/Projects/loco",
        "application_version": null,
        "tracking_uuid": "55b2ba9f-f601-40fb-8cd7-7a270ec42f0c"
    },
    "config": {
        "editor": "phpstorm",
        "theme": "auto",
        "hideSolutions": false,
        "remoteSitesPath": "/home/coco/Projects/loco",
        "localSitesPath": "",
        "enableShareButton": true,
        "enableRunnableSolutions": true,
        "directorySeparator": "/",
        "editorOptions": {
            "sublime": {
                "label": "Sublime",
                "url": "subl://open?url=file://%path&line=%line"
            },
            "textmate": {
                "label": "TextMate",
                "url": "txmt://open?url=file://%path&line=%line"
            },
            "emacs": {
                "label": "Emacs",
                "url": "emacs://open?url=file://%path&line=%line"
            },
            "macvim": {
                "label": "MacVim",
                "url": "mvim://open/?url=file://%path&line=%line"
            },
            "phpstorm": {
                "label": "PhpStorm",
                "url": "phpstorm://open?file=%path&line=%line"
            },
            "idea": {
                "label": "Idea",
                "url": "idea://open?file=%path&line=%line"
            },
            "vscode": {
                "label": "VS Code",
                "url": "vscode://file/%path:%line"
            },
            "vscode-insiders": {
                "label": "VS Code Insiders",
                "url": "vscode-insiders://file/%path:%line"
            },
            "vscode-remote": {
                "label": "VS Code Remote",
                "url": "vscode://vscode-remote/%path:%line"
            },
            "vscode-insiders-remote": {
                "label": "VS Code Insiders Remote",
                "url": "vscode-insiders://vscode-remote/%path:%line"
            },
            "atom": {
                "label": "Atom",
                "url": "atom://core/open/file?filename=%path&line=%line"
            },
            "nova": {
                "label": "Nova",
                "url": "nova://core/open/file?filename=%path&line=%line"
            },
            "netbeans": {
                "label": "NetBeans",
                "url": "netbeans://open/?f=%path:%line"
            },
            "xdebug": {
                "label": "Xdebug",
                "url": "xdebug://%path@%line"
            }
        },
        "shareEndpoint": "https://flareapp.io/api/public-reports"
    },
    "solutions": [],
    "updateConfigEndpoint": "/_ignition/update-config"
}

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://**.209.221.41/:72:249981)
    at mi (http://**.209.221.41/:72:70706)
    at Ql (http://**.209.221.41/:72:122308)
    at xc (http://**.209.221.41/:72:109797)
    at _c (http://**.209.221.41/:72:109725)
    at Cc (http://**.209.221.41/:72:109588)
    at Nc (http://**.209.221.41/:72:106582)
    at hc (http://**.209.221.41/:72:103958)
    at nu (http://**.209.221.41/:72:119816)
    at http://**.209.221.41/:72:121187

User Agent

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36

TypeError: Cannot read properties of undefined (reading 'code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

TypeError: Cannot read properties of undefined (reading 'code_snippet')
    at XE (http://localhost:8080/test/public/:72:249981)
    at mi (http://localhost:8080/test/public/:72:70706)
    at Ql (http://localhost:8080/test/public/:72:122308)
    at xc (http://localhost:8080/test/public/:72:109797)
    at _c (http://localhost:8080/test/public/:72:109725)
    at Cc (http://localhost:8080/test/public/:72:109588)
    at Nc (http://localhost:8080/test/public/:72:106582)
    at hc (http://localhost:8080/test/public/:72:103958)
    at nu (http://localhost:8080/test/public/:72:119816)
    at http://localhost:8080/test/public/:72:121187

User Agent

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36

TypeError: undefined is not an object (evaluating 'n.code_snippet')

Please include some context and the contents of the console in your browser's developer tools.

XE@http://localhost/:74:249980
mi@http://localhost/:74:70707
Ql@http://localhost/:74:122310
xc@http://localhost/:74:109799
_c@http://localhost/:74:109727
Cc@http://localhost/:74:109590
Nc@http://localhost/:74:106584
hc@http://localhost/:74:103960
nu@http://localhost/:74:119818
@http://localhost/:74:121189
Oc@http://localhost/:74:106961
cu@http://localhost/:74:121175
render@http://localhost/:74:128585
@http://localhost/:74:496823
global code@http://localhost/:78:18

User Agent

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.3 Safari/605.1.15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.