LaraBug / LaraBug

Laravel error reporting tool
https://www.larabug.com
MIT License
267 stars 58 forks source link

Larabug don't send exceptions #71

Closed leandrohago closed 2 years ago

leandrohago commented 2 years ago

After install and configure LaraBug with composer, I just run the artisan command to test it and work like a charm. php artisan larabug:test

/usr/src/app $ php artisan larabug:test
✓ [Larabug] Found login key
✓ [Larabug] Found project key
✓ [Larabug] Correct environment found (local)
✓ [LaraBug] Sent exception to LaraBug with ID: 04e75414-4a62-4982-9086-4dfc7756772c

But when I force a exception to test it, I dont't receive anything on dashboard. I created a command to test it:

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;

class SendTestLaraBug extends Command
{
    protected $signature = 'larabug:sendtestlarabug';

    protected $description = 'Command description';

    public function __construct()
    {
        parent::__construct();
    }

    public function handle()
    {
        try {
            throw new \Exception('Send LaraBug Test');
        } catch (\Exception $exception) {
            return $exception;
        }

        return Command::SUCCESS;
    }
}

php artisan larabug:sendtestlarabug

What I'm doing wrong ?

Config:

Glennmen commented 2 years ago

You are catching it and nothing is done with it in that case. Here you can see how the Larabag TestCommand works:

https://github.com/LaraBug/LaraBug/blob/88fa96303007f51f9903e6aef72c27505b5a64de/src/Commands/TestCommand.php#L40-L42

leandrohago commented 2 years ago

Sorry, my mistake. I forgot to change LOG_CHANNEL in .env to stack.

LOG_CHANNEL=stack

After that all exceptions were sending to dashboard.