How to use the @sentry/electron.captureMessage function in @sentry/electron

To help you get started, we’ve selected a few @sentry/electron 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 web-pal / chronos-timetracker / app / renderer / sagas / timer.js View on Github external
) {
      const screenshotTime = yield eff.select(getUiState('screenshotTime'));
      const screenshotTimeId = yield eff.select(getUiState('screenshotTimeId'));
      /* In casee of render freeze, if it will happen often, shift it to the main process */
      if (time >= screenshotTime) {
        if (prevScreenshotId !== screenshotTimeId) {
          prevScreenshotId = screenshotTimeId;
          yield eff.put(screenshotsActions.takeScreenshotRequest({
            isTest: false,
            time,
            timestamp: new Date().getTime(),
          }));
          if (time !== screenshotTime) {
            console.log('TIME !== SCREENSHOTTIME');
            console.log(`time: ${time}, screenshotTime: ${screenshotTime}`);
            Sentry.captureMessage(
              `time !== screenshotTime, time: ${time}, screenshotTime: ${screenshotTime}`,
            );
          }
        }
      }
    }
  }
}
github web-pal / chronos-timetracker / app / renderer / sagas / issues.js View on Github external
acc.entities.worklogs,
        );
      issue.fields.worklogs = worklogs.map(w => w.id);
      delete issue.fields.worklog;
      acc.entities.issues[issue.id] = issue;
      acc.result.push(issue.id);
      return acc;
    }, {
      entities: {
        issues: {},
        worklogs: {},
      },
      result: [],
    });
  } catch (err) {
    Sentry.captureMessage('normalizedIssues error!', {
      level: 'error',
      extra: {
        issues,
      },
    });
    throw err;
  }
}
/* eslint-enable */
github web-pal / chronos-timetracker / app / renderer / sagas / projects.js View on Github external
const metadata = yield eff.call(
        jiraApi.getCreateIssueMetadata,
        {
          params: {
            projectIds: projectId,
          },
        },
      );
      // Some users have strange metada response, it needs to detect issue
      if (
        !metadata
        || !metadata.projects
        || !metadata.projects[0]
        || !metadata.projects[0].issuetypes
      ) {
        Sentry.captureMessage('Issue types empty!', {
          level: 'error',
          extra: {
            metadata,
            projectId,
          },
        });
      } else {
        const issuesTypes = metadata.projects[0].issuetypes;
        yield eff.put(typesActions.succeeded({
          resources: issuesTypes,
        }));
      }

      const statusesResponse = yield eff.call(
        jiraApi.getProjectStatuses,
        {
github web-pal / chronos-timetracker / app / renderer / sagas / initialize.js View on Github external
authCredentials !== null
      && authCredentials.name
      && authCredentials.protocol
      && authCredentials.hostname
    );
    if (authDataExist) {
      try {
        const cookiesStr = yield eff.call(
          keytar.getPassword,
          'Chronos',
          `${authCredentials.name}_${authCredentials.hostname}`,
        );
        const cookies = JSON.parse(cookiesStr);
        authCredentials.cookies = cookies;
      } catch (error) {
        Sentry.captureMessage('keytar error!', {
          level: 'error',
          extra: {
            error,
          },
        });
        yield eff.call(
          throwError,
          error,
        );
        if (process.platform === 'linux') {
          yield eff.fork(
            notify,
            {
              type: 'libSecretError',
              autoDelete: false,
            },
github web-pal / chronos-timetracker / app / renderer / sagas / issues.js View on Github external
];
      yield eff.call(
        infoLog,
        'getAdditionalWorklogsForIssues response:',
        additionalIssuesArr,
      );
      yield eff.call(
        infoLog,
        'filled issues with lacking worklogs: ',
        withAdditionalWorklogs,
      );
      return withAdditionalWorklogs;
    }
    return issues;
  } catch (err) {
    Sentry.captureMessage('Fetch additional worklog issue', {
      level: 'error',
      extra: {
        issues,
      },
    });
    throwError(err);
    return issues;
  }
}