0.2.15 • Published 5 days ago
@trenskow/fail-silently v0.2.15
@trenskow/fail-silently
A simple function wrapper for ignoring errors thrown.
Usage
You wrap the function you want to ignore errors thrown from as the example below.
const
failSilently = require('@trenskow/fail-silently');
function myThrowingFunction(shouldThrow) {
if (shouldThrow) throw new Error("This is my error.");
return 'Hello, World!';
}
failSilently(myThrowingFunction)(false); // -> 'Hello, World!'
failSilently(myThrowingFunction)(true); // -> undefined
It also works with
async
functions.
LICENSE
See license in LICENSE
0.2.15
5 days ago
0.2.14
1 month ago
0.2.13
1 month ago
0.2.12
1 month ago
0.2.11
1 month ago
0.2.10
3 months ago
0.2.9
3 months ago
0.2.8
4 months ago
0.2.7
5 months ago
0.2.6
5 months ago
0.2.5
11 months ago
0.2.3
12 months ago
0.1.14
1 year ago
0.1.15
1 year ago
0.2.1
1 year ago
0.2.0
1 year ago
0.1.10
1 year ago
0.1.11
1 year ago
0.1.12
1 year ago
0.1.13
1 year ago
0.1.8
2 years ago
0.1.9
1 year ago
0.1.7
2 years ago
0.1.4
3 years ago
0.1.6
3 years ago
0.1.5
3 years ago
0.1.2
3 years ago
0.1.3
3 years ago
0.1.1
3 years ago
0.1.0
3 years ago