Skip to content

Commit

Permalink
Do not log errors on halt. Implementations should be able to chose ho…
Browse files Browse the repository at this point in the history
…w to handle.
  • Loading branch information
ariademur committed May 6, 2021
1 parent 4531d54 commit ab2f677
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/WebServCo/Framework/AbstractApplication.php
Expand Up @@ -145,22 +145,20 @@ final protected function handleErrors(?\Throwable $exception = null): bool

final protected function halt(\Throwable $throwable): bool
{
$errorProcessor = new \WebServCo\Framework\Processors\ErrorProcessor();
$errorProcessor->logException($throwable);
return \WebServCo\Framework\Helpers\PhpHelper::isCli()
? $this->haltCli($throwable)
: $this->haltHttp($throwable);
}

final protected function haltCli(\Throwable $throwable): bool
protected function haltCli(\Throwable $throwable): bool
{
$output = $this->getCliOutput($throwable);
$response = new \WebServCo\Framework\Cli\Response($output, 1);
$response->send();
return true;
}

final protected function haltHttp(\Throwable $throwable): bool
protected function haltHttp(\Throwable $throwable): bool
{
$output = $this->getHttpOutput($throwable);

Expand Down

0 comments on commit ab2f677

Please sign in to comment.