Flare Error tracking made for Laravel
Features Pricing Docs Blog Log in Start free trial Free trial
  • Docs
  • Videos

Documentation

  • General

    • Welcome
    • Projects
    • Errors
    • Error occurrences
    • Using the API
    • Sharing error occurrences
    • Spike protection
    • GitHub integration
  • Ignition for Laravel

    • Installation
    • Configuration
    • Security
    • Controlling collected data
    • Sending logs to Flare
    • Linking to errors
    • Identifying users
    • Adding custom context
    • Adding glows
    • Writing custom middleware
  • Flare for generic PHP projects

    • Installation
    • Controlling collected data
    • Identifying users
    • Linking to errors
    • Adding custom context
    • Adding glows
    • Writing custom middleware
  • Javascript error tracking

    • Installation
    • Framework integrations
    • Resolving Bundled Code
    • Reporting errors
    • Client hooks
    • Adding custom context
    • Adding glows
    • Solution Providers
  • Solutions

    • Introduction
    • Adding custom solutions
    • Making solutions runnable
    • Using solution providers
    • Writing good solutions
  • Notifications

    • Configuring notifications
    • Mail
    • Slack
    • Telegram
    • SMS
    • Webhooks
    • Discord
    • Microsoft Teams
  • Team management

    • Using multiple teams
    • Subscribing to a plan
    • Receiving invoices
    • Managing team members
    • Inviting guests to projects

Reporting errors

Once registered using flare.light(), the @flareapp/flare-client will automatically catch and report errors that bubble up to the window object. This includes most errors in vanilla JavaScript code that isn't wrapped in a try…catch block. Errors that are caught by, for example, Axios' catch block, will not be reported automatically. Keep on reading to find out how to send those errors to Flare too.

Reporting caught errors

You can report errors in catch statements or error boundaries using the flare.report() method:

import { flare } from "@flareapp/flare-client"; try { functionThatMightThrow(); } catch (error) { flare.report(error); }

Sending logs to Flare

If you don't have an error object, but you just want to send a simple log message to Flare, you can use the reportMessage method instead:

flare.reportMessage('log message');

This method has 2 optional parameters: a context object, and an exceptionClass string:

flare.reportMessage( 'log message', { moreCustomContext: [1, 2, 3], }, 'CriticalLog', );
Previous topic Next topic

On this page

  • Reporting caught errors
  • Sending logs to Flare

About Flare

  • Home
  • Features
  • Pricing
  • Support

Resources

  • Blog
  • Changelog
  • Docs
  • Ignition

App

  • Log in
  • Start free trial
SPATIE
  • Service status
  • Terms of use
  • Privacy & cookie policy