logger->error(sprintf('%s[%s] in %s', $throwable->getMessage(), $throwable->getLine(), $throwable->getFile())); // $this->logger->error($throwable->getTraceAsString()); $this->log->error(sprintf('%s[%s] in %s', $throwable->getMessage(), $throwable->getLine(), $throwable->getFile())); $this->log->error($throwable->getTraceAsString()); $result = $this->return->error('Internal Server Error.'); return $response->withHeader("Content-Type", "application/json") ->withStatus(200) ->withBody(new SwooleStream(json_encode($result, JSON_UNESCAPED_UNICODE))); // return $response->withHeader('Server', 'Hyperf')->withStatus(500)->withBody(new SwooleStream('Internal Server Error.')); } public function isValid(Throwable $throwable): bool { return true; } }