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

Feature/flare helper #182

Closed
wants to merge 2 commits into from
Closed

Conversation

chrispage1
Copy link

Right now, if I handle an exception, there is no particularly easy way to still pass that to Flare. Sometimes, I want to gracefully handle an error but still let Flare know that something went wrong, and give some context to the error.

This simple helper method allows Flare to be notified while continuing the execution of the script. Example usage below...

try {
    throw new Exception('This shouldnt have happened');
} catch (Exception $e) {

    // gracefully continue but let Flare know
    flare($e, ['process' => 'user registration']);

    return [
      'success' => false,
      'message' => 'Sorry, unable to register you right now...'
    ];
}

@freekmurze
Copy link
Member

Laravel comes with a native report function that allows you to do this 👍

@freekmurze freekmurze closed this Mar 8, 2024
@chrispage1
Copy link
Author

Laravel comes with a native report function that allows you to do this 👍

You learn something new every day! 🤦

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants