Function.thrower >= 0.1.4

Purpose

A function that will `throw` the first argument (if it is truthy)

Description

Like `Function.dummy`, this can be used as a default callback parameter

Syntax

Function.thrower ( Errorerr );

Parameters

err

Should be an Error, but can be anything

Return values

Examples

Use as callback

function myErrorFnc(callback) {
    callback(new Error('There has been an error!'));
}

myErrorFnc(Function.thrower);
>>> throws Error('There has been an error!')

function myNonErrorFnc(callback) {
    callback(null);
}

myNonErrorFnc(Function.thrower);
>>> throws nothing

Comments

Leonor

I located your web site from Google and I need to state it was a fantastic locate. Thanks!

Gertrude

Your site has exceptional material. I bookmarked the site

Will

Could you inform me what theme are you utilizing on your site? It looks great.