1.1.4 • Published 6 months ago

donot_fail v1.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

Please Do not Fail !

Why use?

In Programming everything is not always predictable.So We need to put a shield over our code to overcome unintended errors.Simply put if request something from an external provider, Like creating payment gateway token,send an EMail / SMS via API.In these situations we have to determine what to do when these providers went down even for a fraction of second.Thats where you can use this package.

How to use?

    Syntax:
    tryAgain(RETRYABLE_FUNCTION,TIMES_WANT_TO_RETRY,TIME_INTERVAL_IN_SECONDS,FUNCTION_TO_EXECUTE_ON_SUCCESS,FUNCTION_TO_EXECUTE_ON_FAILURE,param1,param2,paramN)

Example

    const donot_fail=require('donot_fail')

    const codeThatMayFail=(name,apiKey)=>{
        actionThatMayFail()
    }

   const secondsToRetry=1 //this will be doubled after each retry

   donot_fail(codeThatMayFail,5,1,
   (result) => {console.log("Result is " + result);},
   (error) => {console.log("Error is " + error);},
   "Alex",
   "api_key_12345")
1.1.4

6 months ago

1.1.3

6 months ago

1.1.2

7 months ago

1.1.1

7 months ago

1.1.0

7 months ago

1.0.14

7 months ago

1.0.13

7 months ago