Rapsys Git
/
packbundle
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7443608
)
Catch directory creation failure with a nice message
author
Raphaël Gertz
<git@rapsys.eu>
Mon, 26 Mar 2018 09:28:24 +0000
(11:28 +0200)
committer
Raphaël Gertz
<git@rapsys.eu>
Mon, 26 Mar 2018 09:29:30 +0000
(11:29 +0200)
Twig/PackTokenParser.php
patch
|
blob
|
history
diff --git
a/Twig/PackTokenParser.php
b/Twig/PackTokenParser.php
index 2644a1bea9814f0667171e760ef091fcb1d701af..64de8e5fbb10105ba889fc9baa2435737eb26585 100644
(file)
--- a/
Twig/PackTokenParser.php
+++ b/
Twig/PackTokenParser.php
@@
-216,7
+216,11
@@
class PackTokenParser extends \Twig_TokenParser {
//Create output dir on demand
if (!is_dir($parent = $dir = dirname($this->prefix.$output))) {
//XXX: set as 0777, symfony umask (0022) will reduce rights (0755)
- mkdir($dir, 0777, true);
+ try {
+ mkdir($dir, 0777, true);
+ } catch (\Exception $e) {
+ throw new \Twig_Error_Syntax(sprintf('Unable to create directory: %s', $dir), $token->getLine(), $stream->getSourceContext());
+ }
}
//Send file content