Helpers to build consistent error responses (JSON/text) without coupling to any specific web framework.