How to use the logrocket.error function in logrocket

To help you get started, we’ve selected a few logrocket examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rlesniak / tind3r.com / src / stores / MatchStore.js View on Github external
@action async fetch(errorCallback: () => void) {
    this.isLoading = true;

    try {
      const { matches, messages } = await FetchService.updates(); // eslint-disable-line

      if (matches.length || messages.length) {
        this.getFromDb();
      }

      this.isLoading = false;
    } catch (err) {
      LogRocket.error('fetch', err);

      if (err && window.Bugsnag) {
        Bugsnag.notifyException(err);
      }

      if (err.type) {
        if (window.Bugsnag) {
          Bugsnag.notifyException(new Error('dbError'), 'fetch()', { type: err.type, data: err.data, size: err.size });
        }

        if (window.hj) {
          window.hj('tagRecording', ['With error']);
        }
      } else if (typeof errorCallback === 'function') errorCallback();
      this.isLoading = false;
    }

logrocket

JavaScript SDK for [LogRocket](https://logrocket.com/)

MIT
Latest version published 2 months ago

Package Health Score

68 / 100
Full package analysis