How to use the stacktrace-js.report function in stacktrace-js

To help you get started, we’ve selected a few stacktrace-js 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 mikey1384 / twinkle-network / source / components / ErrorBoundary.js View on Github external
async componentDidCatch(error, info) {
    this.setState({ hasError: true });
    const errorStack = await StackTrace.fromError(error);
    await StackTrace.report(errorStack, `${URL}/user/error`, {
      clientVersion,
      message: error.message,
      info: info?.componentStack,
      token: auth()?.headers?.authorization
    });
    console.log(error);
  }
github born2net / studio-lite / src / services / global-error-handler.ts View on Github external
StackTrace.fromError(error).then(stackframes => {
            const stackString = stackframes
                .splice(0, 20)
                .map(function (sf) {
                    return sf.toString();
                }).join('\n');
            var date = moment().format('YYYY-MM-DD h:mm:ss');
            message = `error :: business :: ${window['business_id']} :: studiolite :: ${date} :: ${message}`
            StackTrace.report(stackString, url, message);
        });
        throw error;

stacktrace-js

Framework-agnostic, micro-library for getting stack traces in all environments

MIT
Latest version published 4 years ago

Package Health Score

79 / 100
Full package analysis