Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: create a reporting for exception #8

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

komtcho
Copy link
Contributor

@komtcho komtcho commented Dec 2, 2023

If you need to send any exception to obelaw error via the notify method

$this->reportable(function (Throwable $e) {
    if (app()->bound('obelaw.report')) {
        app('obelaw.report')->notify($e, app('request'));
    }
});

You can create a listener to listen on event \Obelaw\Framework\Events\Reporting\SendReport::class.

If you need to render a view for the exception, you can use the render method

$this->renderable(function (\Exception $e, Request $request) {
    if (app()->bound('obelaw.report')) {
        return app('obelaw.report')->render($e, $request);
    }
});

@komtcho komtcho added the enhancement New feature or request label Dec 2, 2023
@komtcho komtcho self-assigned this Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant