stopPropagation(); $content = json_encode( [ "status" => 'error', "code" => ErrorCode::SSDB_ERROR, "result" => [], "message" => $throwable->getMessage() ?: ErrorCode::getMessage(ErrorCode::SSDB_ERROR) ] ); return $response->withHeader('Content-Type', 'application/json') ->withStatus($throwable->status) ->withBody(new SwooleStream($content)); } public function isValid(Throwable $throwable): bool { return $throwable instanceof SsdbException; } }