Skip to content

Commit

Permalink
Improve error logging as per @jpwhite4
Browse files Browse the repository at this point in the history
  • Loading branch information
smgallo committed Jun 11, 2019
1 parent 07d9076 commit 63fb84b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions classes/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,12 @@ public function __construct(
// Set the last modified time of the global config file

$fileStats = stat($this->filename);
if ( false === $fileStats ) {
$err = error_get_last();
$this->logAndThrowException(
sprintf("Error calling stat() on global configuration file %s: %s", $this->filename, $err['message'])
);
}
$this->maxLastModifiedTime = $fileStats['mtime'];
}

Expand Down Expand Up @@ -640,6 +646,12 @@ public function scanLocalConfigDir($force = false)
$fullpath = $this->localConfigDir . '/' . $file;
$this->localConfigFiles[] = $fullpath;
$fileStats = stat($fullpath);
if ( false === $fileStats ) {
$err = error_get_last();
$this->logAndThrowException(
sprintf("Error calling stat() on local configuration file %s: %s", $fullpath, $err['message'])
);
}
$this->maxLastModifiedTime = max($this->maxLastModifiedTime, $fileStats['mtime']);
}

Expand Down

0 comments on commit 63fb84b

Please sign in to comment.