Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

Commit

Permalink
III-3528 Rename UncaughtErrorHandler to SentryErrorHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
LucWollants committed Oct 7, 2020
1 parent 45fd4c2 commit 38d99b1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/ApiErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
class ApiErrorHandler
{
/**
* @var UncaughtErrorHandler
* @var SentryErrorHandler
*/
private $uncaughtErrorHandler;

public function __construct(UncaughtErrorHandler $uncaughtErrorHandler)
public function __construct(SentryErrorHandler $uncaughtErrorHandler)
{
$this->uncaughtErrorHandler = $uncaughtErrorHandler;
}
Expand Down
6 changes: 3 additions & 3 deletions app/ErrorHandlerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ class ErrorHandlerProvider implements ServiceProviderInterface
{
public function register(Application $app): void
{
$app[UncaughtErrorHandler::class] = $app->share(
$app[SentryErrorHandler::class] = $app->share(
function ($app) {
return new UncaughtErrorHandler($app[HubInterface::class]);
return new SentryErrorHandler($app[HubInterface::class]);
}
);

$app[ApiErrorHandler::class] = $app->share(
function () use ($app) {
return new ApiErrorHandler($app[UncaughtErrorHandler::class]);
return new ApiErrorHandler($app[SentryErrorHandler::class]);
}
);
$app->error($app[ApiErrorHandler::class]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Sentry\State\HubInterface;
use Throwable;

class UncaughtErrorHandler
class SentryErrorHandler
{
/** @var HubInterface */
private $sentryHub;
Expand Down
4 changes: 2 additions & 2 deletions tests/ApiErrorHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ class ApiErrorHandlerTest extends TestCase
/** @var HubInterface|PHPUnit_Framework_MockObject_MockObject */
private $sentryHub;

/** @var UncaughtErrorHandler */
/** @var SentryErrorHandler */
private $uncaughtErrorHandler;

protected function setUp(): void
{
parent::setUp();

$this->sentryHub = $this->createMock(HubInterface::class);
$this->uncaughtErrorHandler = new UncaughtErrorHandler($this->sentryHub);
$this->uncaughtErrorHandler = new SentryErrorHandler($this->sentryHub);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use CultuurNet\UDB3\UiTPASService\Controller\OrganizerControllerProvider;
use CultuurNet\UDB3\UiTPASService\ErrorHandlerProvider;
use CultuurNet\UDB3\UiTPASService\SentryServiceProvider;
use CultuurNet\UDB3\UiTPASService\UncaughtErrorHandler;
use CultuurNet\UDB3\UiTPASService\SentryErrorHandler;
use Silex\Application;
use Silex\Provider\SecurityServiceProvider;
use Silex\Provider\ServiceControllerServiceProvider;
Expand Down Expand Up @@ -114,6 +114,6 @@ function(Application $app) {
try {
$app->run();
} catch (Throwable $throwable) {
$app[UncaughtErrorHandler::class]->handle($throwable);
$app[SentryErrorHandler::class]->handle($throwable);
throw $throwable;
}

0 comments on commit 38d99b1

Please sign in to comment.