# Classify Domain and System Errors to Set HTTP Status, Logging, and Paging

DevFeed: [Classify Domain and System Errors to Set HTTP Status, Logging, and Paging](<https://devfeed.tech/articles/stop-throwing-new-error-it-s-lying-to-your-logs-18109.md>)

Original publisher: [Read original article](<https://thetshaped.dev/p/domain-errors-are-features-system-errors-are-bugs-error-handling>)

Author: The T-Shaped Dev

Published: 2026-08-29T04:19:38Z

Content type: tutorial

Language: en

Sources: [The T-Shaped Dev](<https://devfeed.tech/sources/the-t-shaped-dev.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [HTTP](<https://devfeed.tech/topics/http.md>), [API](<https://devfeed.tech/topics/api.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [code](<https://devfeed.tech/tags/code.md>), [errors](<https://devfeed.tech/tags/errors.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [http](<https://devfeed.tech/tags/http.md>), [logs](<https://devfeed.tech/tags/logs.md>), [middleware](<https://devfeed.tech/tags/middleware.md>), [on-call](<https://devfeed.tech/tags/on-call.md>)

## AI overview

This tutorial distinguishes expected domain errors, such as invalid input or forbidden actions, from unexpected system errors, such as database failures, upstream timeouts, and memory exhaustion. It proposes encoding the distinction in error types so middleware can determine the HTTP status, user message, log level, and paging behavior.

## Source excerpt

One distinction that sets your HTTP status, your log level, and who gets paged. (6 min)