Skip to content

Commit 24d5b72

Browse files
committed
Thow exception if token is empty
1 parent 8c64294 commit 24d5b72

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/RollbarServiceProvider.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php namespace Jenssegers\Rollbar;
22

33
use Illuminate\Support\ServiceProvider;
4+
use InvalidArgumentException;
45
use Rollbar;
56
use RollbarNotifier;
67

@@ -49,6 +50,10 @@ public function register()
4950

5051
$config['access_token'] = getenv('ROLLBAR_TOKEN') ?: $app['config']->get('services.rollbar.access_token');
5152

53+
if (empty($config['access_token'])) {
54+
throw new InvalidArgumentException('Rollbar access token not configured');
55+
}
56+
5257
Rollbar::$instance = $rollbar = new RollbarNotifier($config);
5358

5459
return $rollbar;

0 commit comments

Comments
 (0)