Throw RuntimeException if FirePHP Class can't be found #2403

Closed
wants to merge 2 commits into
from

Projects

None yet

3 participants

@b-durand b-durand commented on an outdated diff Sep 22, 2012
library/Zend/Log/Writer/FirePhp.php
@@ -94,7 +95,10 @@ public function getFirePhp()
// FirePHPService is an alias for FirePHP; otherwise the class
// names would clash in this file on this line.
$this->setFirePhp(new FirePhp\FirePhpBridge(new FirePHPService()));
+ } elseif (!class_exists('FirePHP')) {
+ throw new RuntimeException('FirePHP Class not found');
b-durand
b-durand Sep 22, 2012 Contributor

Bad indent here: 1 soft-tab = 4 spaces. And add, tag @throws in the DocBlock.

Contributor

I don't know if we need an exception here. We broke the app for the logger 😞

How we can be notify from an exception in the logger process with an another writer? Maybe trigger a warning instead...
Thought?

Contributor
rufinus commented Sep 22, 2012

You are right, I thought about that problem too befor i commited the patch.

but FirePHP should only be used in dev instances. So breaking the logger may be not so a bad idea anymore.

Owner

@b-durand It's standard throughout the framework that if a class depends on an extension or a third-party class, and that dependency is not found, we raise an exception.

@weierophinney weierophinney added a commit that referenced this pull request Sep 25, 2012
@weierophinney weierophinney [ZF2-454][#2403] Logic tweaks
- Import Exception namespace, not individual exceptions
  - Update @throws annotation accordingly
- Throw early
19844a4
@weierophinney weierophinney added a commit that referenced this pull request Sep 25, 2012
@weierophinney weierophinney Merge branch 'hotfix/zf2-454' into develop
Forward port #2403
d9bf765
@weierophinney weierophinney added a commit to zendframework/zend-log that referenced this pull request May 15, 2015
@weierophinney weierophinney [ZF2-454][zendframework/zendframework#2403] Logic tweaks
- Import Exception namespace, not individual exceptions
  - Update @throws annotation accordingly
- Throw early
340bd1d
@weierophinney weierophinney added a commit to zendframework/zend-log that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/zf2-454' 40d86d0
@weierophinney weierophinney added a commit to zendframework/zend-log that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/zf2-454' into develop 57fb081
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment