Skip to content

Commit f55680b

Browse files
committed
bug symfony#18813 Catch \Throwable (fprochazka)
This PR was merged into the 2.7 branch. Discussion ---------- Catch \Throwable | Q | A | ------------- | --- | Branch? | 2.7, 2.8, 3.0 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | Yes | Fixed tickets | n/a | License | MIT | Doc PR | n/a Related symfony#18765, symfony#15949 Depends on symfony#18812 Commits ------- 103526b Catch \Throwable
2 parents d834142 + 103526b commit f55680b

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ public function loadClass($class)
175175
} catch (\Exception $e) {
176176
ErrorHandler::unstackErrors();
177177

178+
throw $e;
179+
} catch (\Throwable $e) {
180+
ErrorHandler::unstackErrors();
181+
178182
throw $e;
179183
}
180184

src/Symfony/Component/Debug/ErrorHandler.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,10 @@ public function handleError($type, $message, $file, $line, array $context, array
447447
} catch (\Exception $e) {
448448
$this->isRecursive = false;
449449

450+
throw $e;
451+
} catch (\Throwable $e) {
452+
$this->isRecursive = false;
453+
450454
throw $e;
451455
}
452456
}
@@ -555,6 +559,8 @@ public static function handleFatalError(array $error = null)
555559
}
556560
} catch (\Exception $exception) {
557561
// Handled below
562+
} catch (\Throwable $exception) {
563+
// Handled below
558564
}
559565

560566
if ($error && $error['type'] &= E_PARSE | E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR) {

src/Symfony/Component/OptionsResolver/OptionsResolver.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,9 @@ public function offsetGet($option)
861861
} catch (\Exception $e) {
862862
unset($this->calling[$option]);
863863
throw $e;
864+
} catch (\Throwable $e) {
865+
unset($this->calling[$option]);
866+
throw $e;
864867
}
865868
unset($this->calling[$option]);
866869
// END
@@ -963,6 +966,9 @@ public function offsetGet($option)
963966
} catch (\Exception $e) {
964967
unset($this->calling[$option]);
965968
throw $e;
969+
} catch (\Throwable $e) {
970+
unset($this->calling[$option]);
971+
throw $e;
966972
}
967973
unset($this->calling[$option]);
968974
// END

src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ public function dump(Data $data, $output = null)
141141
$this->dumpLine(-1);
142142
} catch (\Exception $exception) {
143143
// Re-thrown below
144+
} catch (\Throwable $exception) {
145+
// Re-thrown below
144146
}
145147
if ($output) {
146148
$this->setOutput($prevOutput);

0 commit comments

Comments
 (0)