getMessage(); $error = explode('|', $message, 2); $code = $error[1] ?? $throwable->getCode() ?: ErrorCode::COMMON_ERROR; $data = Result::error($code, $error[0]); $responseStr = json_encode($data, JSON_UNESCAPED_UNICODE); return $response->withHeader('Content-Type', 'application/json')->withBody(new SwooleStream($responseStr)); } public function isValid(Throwable $throwable): bool { return true; } }