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

flare() helper method #181

Closed
wants to merge 1 commit into from
Closed

flare() helper method #181

wants to merge 1 commit into from

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...'
    ];
}

@chrispage1 chrispage1 closed this Mar 7, 2024
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.

1 participant