10000 Config: catch Throwable · symfony/symfony@489f8ac · GitHub
[go: up one dir, main page]

Skip to content

Commit 489f8ac

Browse files
committed
Config: catch Throwable
1 parent fbbbc9a commit 489f8ac

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/Symfony/Component/Config/Definition/BaseNode.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ final public function finalize($value)
311311
throw $e;
312312
} catch (\Exception $e) {
313313
throw new InvalidConfigurationException(sprintf('Invalid configuration for path "%s": %s', $this->getPath(), $e->getMessage()), $e->getCode(), $e);
314+
} catch (\Throwable $e) {
315+
throw new InvalidConfigurationException(sprintf('Invalid configuration for path "%s": %s', $this->getPath(), $e->getMessage()), $e->getCode(), $e);
314316
}
315317
}
316318

src/Symfony/Component/Config/Loader/FileLoader.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ public function import($resource, $type = null, $ignoreErrors = false, $sourceRe
130130
throw $e;
131131
}
132132

133+
throw new FileLoaderLoadException($resource, $sourceResource, null, $e);
134+
}
135+
} catch (\Throwable $e) {
136+
if (!$ignoreErrors) {
133137
throw new FileLoaderLoadException($resource, $sourceResource, null, $e);
134138
}
135139
}

src/Symfony/Component/Config/Util/XmlUtils.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ public static function loadFile($file, $schemaOrCallable = null)
7878
$valid = call_user_func($schemaOrCallable, $dom, $internalErrors);
7979
} catch (\Exception $e) {
8080
$valid = false;
81+
} catch (\Throwable $e) {
82+
$valid = false;
8183
}
8284
} elseif (!is_array($schemaOrCallable) && is_file((string) $schemaOrCallable)) {
8385
$schemaSource = file_get_contents((string) $schemaOrCallable);

0 commit comments

Comments
 (0)
0