Skip to content

Commit e095efe

Browse files
committed
Use the error logger to log the exception message
1 parent c0b478e commit e095efe

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/WaterPipe/WaterPipe.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,11 +570,10 @@ private function _executeRequest()
570570
$this->_executeAction($this->_errorsRegistry[ResponseStatus::InternalServerErrorCode]);
571571
} else {
572572
$config = WaterPipeConfig::get();
573-
if ($config->useStderr()) {
574-
$stream = fopen("php://stderr", 'w');
573+
$logger = $config->errorLogger();
574+
if ($logger !== null) {
575575
$string = $e->__toString();
576-
fwrite($stream, $string, strlen($string));
577-
fclose($stream);
576+
$logger->log($string);
578577
} else throw $e;
579578
}
580579
}

0 commit comments

Comments
 (0)