/Knowledge/sources/honojs__hono/llms-full/rpc-status-code--part-02--5df4ade0e4cb.md
RPC: Status code (part 02) - hono-docs
RPC: Status code (part 02) Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https://hono.dev/llms full.txt status code Summary ts // c...
RPC: Status code (part 02)
Source evidence: /Sources/honojs__hono/provenance.md Canonical citation: https://hono.dev/llms-full.txt#status-code
Summary
## Content
```ts
// client.ts
const client = hc<AppType>('http://localhost:8787/')
const res = await client.posts.$get({
query: {
id: '123',
},
})
if (res.status === 404) {
const data: { error: string } = await res.json()
console.log(data.error)
}
if (res.ok) {
const data: { post: Post } = await res.json()
console.log(data.post)
}
// { post: Post } | { error: string }
type ResponseType = InferResponseType<typeof client.posts.$get>
// { post: Post }
type ResponseType200 = InferResponseType<
typeof client.posts.$get,
200
>
Metadata
{
"chunk_index": 1,
"citation": "https://hono.dev/llms-full.txt#status-code",
"coverage_role": "overview",
"qualified_title": "Hono / llms-full / RPC > Status code (2)",
"retrieved_at": "2026-07-02T05:51:01Z",
"section_index": 50,
"source_id": "/honojs/hono",
"source_type": "llms_full",
"target_label": "llms-full",
"title": "RPC: Status code (part 02)",
"upstream_url": "https://hono.dev/llms-full.txt",
"version": "2026"
}