Skip to content

Commit d711912

Browse files
check for missing api key, fixes #60
1 parent 4f6a36d commit d711912

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Module.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ public function onBootstrap(MvcEvent $event)
8282
}
8383

8484
$sentryApiKey = $this->config['zend-sentry']['sentry-api-key'];
85+
86+
// Do preliminary checks only, Raven will parse the string further
87+
if (!$sentryApiKey || '' === $sentryApiKey || \is_null($sentryApiKey)) {
88+
throw new \Raven_Exception('Missing Sentry API key.');
89+
}
8590
$ravenClient = new Raven($sentryApiKey, $ravenConfig);
8691

8792
// Register the RavenClient as a application wide service
@@ -261,4 +266,4 @@ private function convertKeyToPublic($key): string
261266
// ... replace it with an empty string
262267
return str_replace($privatePart, '', $key);
263268
}
264-
}
269+
}

0 commit comments

Comments
 (0)