Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 27249d3

Browse files
committed
[zendframework/zendframework#2210] Pass ErrorHandler::stop() result as previous exception
- Per @mark-mabe - Any place where an exception is throw immediately following an ErrorHandler::stop() call should pass the result of that call as the previous exception.
1 parent 8462cde commit 27249d3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Adapter/Digest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,9 @@ public function authenticate()
172172

173173
ErrorHandler::start(E_WARNING);
174174
$fileHandle = fopen($this->filename, 'r');
175-
ErrorHandler::stop();
175+
$error = ErrorHandler::stop();
176176
if (false === $fileHandle) {
177-
throw new Exception\UnexpectedValueException("Cannot open '$this->filename' for reading");
177+
throw new Exception\UnexpectedValueException("Cannot open '$this->filename' for reading", 0, $error);
178178
}
179179

180180
$id = "$this->username:$this->realm";

src/Adapter/Http/FileResolver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ public function resolve($username, $realm, $password = null)
105105

106106
// Open file, read through looking for matching credentials
107107
ErrorHandler::start(E_WARNING);
108-
$fp = fopen($this->file, 'r');
109-
ErrorHandler::stop();
108+
$fp = fopen($this->file, 'r');
109+
$error = ErrorHandler::stop();
110110
if (!$fp) {
111-
throw new Exception\RuntimeException('Unable to open password file: ' . $this->file);
111+
throw new Exception\RuntimeException('Unable to open password file: ' . $this->file, 0, $error);
112112
}
113113

114114
// No real validation is done on the contents of the password file. The

0 commit comments

Comments
 (0)