Skip to content

Commit eea039f

Browse files
author
Markus
authored
Merge pull request #49 from masarliev/zf3-compat
fix error template and viewhelpermanager
2 parents 5cee386 + bdf7d0b commit eea039f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Module.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,15 @@ protected function setupExceptionLogging(MvcEvent $event)
183183
$exceptionStrategy = $event->getApplication()->getServiceManager()->get('HttpExceptionStrategy');
184184
$exceptionStrategy->detach($this->eventManager);
185185
}
186-
186+
187187
// Check if script is running in console
188188
$exceptionStrategy = (PHP_SAPI == 'cli') ? (new SentryConsoleStrategy()) : (new SentryHttpStrategy());
189189
$exceptionStrategy->attach($this->eventManager);
190190
$exceptionStrategy->setDisplayExceptions($this->config['zend-sentry']['display-exceptions']);
191191
$exceptionStrategy->setDefaultExceptionMessage($this->config['zend-sentry'][(PHP_SAPI == 'cli') ? 'default-exception-console-message' : 'default-exception-message']);
192-
192+
if ($exceptionStrategy instanceof SentryHttpStrategy && isset($this->config['view_manager']['exception_template'])) {
193+
$exceptionStrategy->setExceptionTemplate($this->config['view_manager']['exception_template']);
194+
}
193195
$ravenClient = $this->ravenClient;
194196

195197
// Attach an exception listener for the ZendSentry exception strategy, can be triggered from anywhere else too
@@ -209,7 +211,7 @@ protected function setupExceptionLogging(MvcEvent $event)
209211
*/
210212
protected function setupJavascriptLogging(MvcEvent $event)
211213
{
212-
$viewHelper = $event->getApplication()->getServiceManager()->get('viewhelpermanager')->get('headscript');
214+
$viewHelper = $event->getApplication()->getServiceManager()->get('ViewHelperManager')->get('headscript');
213215
$viewHelper->offsetSetFile(0, '//cdn.ravenjs.com/3.8.0/raven.min.js');
214216
$publicApiKey = $this->convertKeyToPublic($this->config['zend-sentry']['sentry-api-key']);
215217
$viewHelper->offsetSetScript(1, sprintf("Raven.config('%s').install()", $publicApiKey));

0 commit comments

Comments
 (0)