Skip to content

Commit 076533d

Browse files
author
Nils Langner
committed
Added better error handling when creating dirs
1 parent 263289e commit 076533d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

module/VisualCeption.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,13 @@ private function getScreenshotPath ($identifier)
117117
{
118118
$debugDir = \Codeception\Configuration::logDir() . 'debug/tmp/';
119119
if (! is_dir($debugDir)) {
120+
$created = mkdir($debugDir, 0777, true);
121+
if( $created ) {
120122
$this->debug("Creating directory: $debugDir");
121-
mkdir($debugDir, 0777, true);
123+
}else{
124+
throw new \RuntimeException("Unable to create temporary screenshot dir ($debugDir)");
125+
}
126+
122127
}
123128
return $debugDir . $this->getScreenshotName($identifier);
124129
}

0 commit comments

Comments
 (0)