---
title: "Errors, uploads, and endpoint patterns"
description: "Choose the focused endpoint guide for expected failures, multipart uploads, or non-JSON and raw responses."
canonical: "https://sapporta.com/docs/guides/application-code/errors-uploads-and-endpoint-patterns/"
---

> Documentation index: https://sapporta.com/llms.txt

These endpoint patterns share the contract boundary but solve different
problems. Read only the page required by the operation:

- [Expected errors and HTTP mapping](/docs/guides/application-code/expected-errors-and-http-mapping.md)
  covers one typed domain-error family, declared status/code pairs, adapter
  mapping, and browser parsing.
- [Multipart file uploads](/docs/guides/application-code/multipart-file-uploads.md)
  covers contract declaration, the handler `files` argument, row-safe target
  checks, file limits, and multipart exercise.
- [Non-JSON and raw responses](/docs/guides/application-code/non-json-and-raw-responses.md)
  covers typed text/CSV responses and the narrow cases that require a raw
  `Response`.

The shared contract owns the wire shape. The route adapter owns request parsing
and HTTP translation. Domain code owns invariants. Unexpected failures remain
on the application's central error path.

## Related documentation

- [Shared contracts and request validation](/docs/guides/application-code/shared-contracts-and-request-validation.md)
- [Custom API endpoints](/docs/guides/application-code/custom-api-endpoints.md)
- [Contract helpers and wire types](/docs/reference/contracts/contract-helpers-and-wire-types.md)
