1
0
mirror of https://github.com/actions/setup-python.git synced 2026-04-16 19:15:39 +02:00
Files
actions-setup-python/node_modules/nice-try/src/index.js
T
Danny McCormick 39c08a0eaa Initial pass
2019-06-26 21:12:00 -04:00

12 lines
303 B
JavaScript

'use strict'
/**
* Tries to execute a function and discards any error that occurs.
* @param {Function} fn - Function that might or might not throw an error.
* @returns {?*} Return-value of the function when no error occurred.
*/
module.exports = function(fn) {
try { return fn() } catch (e) {}
}