PHPackages                             sfinktah/repeat-if-exception - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sfinktah/repeat-if-exception

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sfinktah/repeat-if-exception
============================

PHP functool: repeat function while it throws an exception

00PHP

Since Feb 10Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sfinktah/repeat-if-exception)[ Packagist](https://packagist.org/packages/sfinktah/repeat-if-exception)[ RSS](/packages/sfinktah-repeat-if-exception/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

```
use Sfinktah\FuncTools\RepeatIfException;

function throw_exception($arg1, $arg2) {
    printf("throw_exception: %s %s\n", $arg1, $arg2);
    throw new Exception("throw_exception");
}

```

### Retry 3 times, with 60 seconds delay between each. Pass arguments `arg1` and `arg2` to function.

[](#retry-3-times-with-60-seconds-delay-between-each--pass-arguments-arg1-and-arg2-to-function)

### By closure

[](#by-closure)

```
RepeatIfException::call(['GuzzleHttp\\Exception\\'], 60, 3, fn($arg1, $arg2) => throw_exception($arg1, $arg2), 'arg1', 'arg2');

```

### By function name

[](#by-function-name)

```
RepeatIfException::call(['GuzzleHttp\\Exception\\'], 60, 3, 'throw_exception', 'arg1', 'arg2');

```

### By static method name (i think)

[](#by-static-method-name-i-think)

```
RepeatIfException::call(['GuzzleHttp\\Exception\\'], 60, 3, ['class', 'method', 'arg1', 'arg2');

```

### By instance method (i think)

[](#by-instance-method-i-think)

```
RepeatIfException::call(['GuzzleHttp\\Exception\\'], 60, 3, [$instance, 'method', 'arg1', 'arg2');

```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/801cd6fe73fa9d4e7b2b8440e2f8ad65bd00b03e58c2b6861cf4b4ac822c5d54?d=identicon)[sfinktah](/maintainers/sfinktah)

---

Top Contributors

[![sfinktah](https://avatars.githubusercontent.com/u/4650770?v=4)](https://github.com/sfinktah "sfinktah (1 commits)")

### Embed Badge

![Health badge](/badges/sfinktah-repeat-if-exception/health.svg)

```
[![Health](https://phpackages.com/badges/sfinktah-repeat-if-exception/health.svg)](https://phpackages.com/packages/sfinktah-repeat-if-exception)
```

###  Alternatives

[stuttter/wp-user-profiles

A sophisticated way to edit users in WordPress

11219.3k1](/packages/stuttter-wp-user-profiles)[fof/analytics

Tracks analytics using Google Analytics, Google Optimize/GTM and Matomo

3543.1k](/packages/fof-analytics)[chrico/wp-fields

Package which provides some re-usable fields for WordPress.

1981.2k](/packages/chrico-wp-fields)[aertmann/history

An improved history backend module for Neos

1070.2k](/packages/aertmann-history)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
