UNPKG

handsontable

Version:

Handsontable is a JavaScript Data Grid available for React, Angular and Vue.

21 lines (20 loc) 648 B
"use strict"; exports.__esModule = true; exports.throwWithCause = throwWithCause; /** * Throws an Error with a Handsontable-specific cause for easy identification. * * Use this helper instead of `throw new Error()` to ensure all Handsontable errors * can be recognized by checking `error.cause?.handsontable === true`. * * @param {string} message The error message to display. * @throws {Error} Always throws an Error with `cause: { handsontable: true }`. */ function throwWithCause(message) { // eslint-disable-next-line handsontable/no-native-error-throw throw new Error(message, { cause: { handsontable: true } }); }