PHPackages                             prestashop/module-lib-error-handler - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. prestashop/module-lib-error-handler

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

prestashop/module-lib-error-handler
===================================

Automatically send module exceptions to sentry

1.0.0(4y ago)2322[1 PRs](https://github.com/PrestaShopCorp/module-lib-error-handler/pulls)AFL-3.0PHPPHP &gt;=7.1.3

Since Apr 27Pushed 3y ago6 watchersCompare

[ Source](https://github.com/PrestaShopCorp/module-lib-error-handler)[ Packagist](https://packagist.org/packages/prestashop/module-lib-error-handler)[ Docs](https://github.com/PrestaShopCorp/module-lib-error-handler)[ RSS](/packages/prestashop-module-lib-error-handler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (6)Used By (0)

PrestaShop Sentry Error handler for Modules
===========================================

[](#prestashop-sentry-error-handler-for-modules)

This repository includes sentry lib with handler that you can use in your PrestaShop Module to catch errors and send it to sentry.

Pre-requisites
--------------

[](#pre-requisites)

You should install this library only on a PrestaShop environment and with PHP 7.1.3 minimum.

Installation
------------

[](#installation)

```
composer require prestashop/module-lib-error-handler

```

Usage
-----

[](#usage)

- To catch all unhandled exceptions in the module you need to init error handler in your main class :

```
    new PrestaShop\Sentry\Handler\Errorhandler($dsn, $module->getLocalPath());

```

- If you want to add custom settings like tags, user and level you should create your own ErrorHandler and extend \\PrestaShop\\Sentry\\Handler\\ErrorHandler :

```
class ErrorHandler extends \PrestaShop\Sentry\Handler\ErrorHandler
{
    /**
     * @var ?Raven_Client
     */
    protected $client;

    public function __construct(Module $module, Env $env)
    {
        parent::__construct($env->get('SENTRY_CREDENTIALS'), $module->getLocalPath());

          $this->setUser(
            [
                'id' => Configuration::get('PS_SHOP_EMAIL'),
                'name' => Configuration::get('PS_SHOP_EMAIL')
            ],
            true
        );

        $this->setLevel(\Sentry\Severity::warning());

             $this->setTags(
             [
                'ps_version' => $module->version,
                'ps_version' => $psAccounts ? $psAccounts->version : false,
                'php_version' => phpversion(),
                'prestashop_version' => _PS_VERSION_,
                'ps_is_enabled' => (int) Module::isEnabled($module->name),
                'ps_is_installed' => (int) Module::isInstalled($module->name),
                'env' => $env->get('SENTRY_ENVIRONMENT')
            ]
        );
    }
}

```

- You can also send exceptions if you catch them by using sentry handle :

```
        $this->errorHandler = $this->module->getService(ErrorHandler::class);
        try {
            throw new ModuleVersionException('test exception');
        } catch (ModuleVersionException $exception) {
            $this->errorHandler->handle($exception);
            return;
        }

```

- There are also extra function that sets default module tags to sentry :

```
    $this->setModuleInfo(Module $module);

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.3% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1476d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15106407?v=4)[Jarvis](/maintainers/ps-jarvis)[@ps-jarvis](https://github.com/ps-jarvis)

---

Top Contributors

[![margud](https://avatars.githubusercontent.com/u/51944825?v=4)](https://github.com/margud "margud (12 commits)")[![Quetzacoalt91](https://avatars.githubusercontent.com/u/6768917?v=4)](https://github.com/Quetzacoalt91 "Quetzacoalt91 (1 commits)")

### Embed Badge

![Health badge](/badges/prestashop-module-lib-error-handler/health.svg)

```
[![Health](https://phpackages.com/badges/prestashop-module-lib-error-handler/health.svg)](https://phpackages.com/packages/prestashop-module-lib-error-handler)
```

###  Alternatives

[sentry/sentry-laravel

Laravel SDK for Sentry (https://sentry.io)

1.3k114.3M154](/packages/sentry-sentry-laravel)[onedrop/shopware-sentry

Sentry integration for Shopware

2055.8k](/packages/onedrop-shopware-sentry)[itgalaxy/sentry-integration

A (unofficial) WordPress plugin to report PHP and JavaScript errors to Sentry

105.6k](/packages/itgalaxy-sentry-integration)

PHPackages © 2026

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