How to use the codesandbox-api.actions.error function in codesandbox-api

To help you get started, we’ve selected a few codesandbox-api 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 codesandbox / codesandbox-client / packages / sandbox-hooks / errors / index.js View on Github external
export default function showError(ref: ErrorRecord) {
  const errorToSend = buildDynamicError(ref);

  if (errorToSend) {
    dispatch(
      actions.error.show(errorToSend.title, errorToSend.message, {
        line: errorToSend.line,
        column: errorToSend.column,
        path: errorToSend.path,
        payload: errorToSend.payload,
      })
    );
  } else {
    // Show based on error
    actions.error.show(ref.error.name, ref.error.message, {
      line: ref.error.lineNumber,
      column: ref.error.columnNumber,
      path: ref.error.fileName,
      payload: {},
    });
  }
}
github codesandbox / codesandbox-client / packages / common / src / components / Preview / index.tsx View on Github external
clearErrors = () => {
    dispatch(actions.error.clear('*', 'browser'));
    if (this.props.onClearErrors) {
      this.props.onClearErrors();
    }
  };
github codesandbox / codesandbox-client / src / sandbox / errors / index.js View on Github external
export default function showError(ref: ErrorRecord) {
  const errorToSend = buildDynamicError(ref);
  if (errorToSend) {
    dispatch(
      actions.error.show(errorToSend.title, errorToSend.message, {
        line: errorToSend.line,
        column: errorToSend.column,
        path: errorToSend.path,
        payload: errorToSend.payload,
      })
    );
  }
}

codesandbox-api

[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) [![Greenkeeper badge](https://badges.greenkeeper.io/alexjoverm/typescript-library-starter.svg)](https://greenkeeper.io/) [![Travi

MIT
Latest version published 4 years ago

Package Health Score

73 / 100
Full package analysis

Similar packages