Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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: {},
});
}
}
clearErrors = () => {
dispatch(actions.error.clear('*', 'browser'));
if (this.props.onClearErrors) {
this.props.onClearErrors();
}
};
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,
})
);
}
}