UNPKG

dataframe-js

Version:

Immutable and functional data structure for datascientists and developpers

13 lines (12 loc) 273 B
/** * Catch an error on a function and returns it. * @param {Function} func The function to evaluate. * @returns {Object} The Error generated by the function. */ export function tryCatch(func) { try { func(); } catch (err) { return err; } }