v.24.11Improvement

Exceptions Violate HTTP Protocol to Notify Clients of Errors

Exceptions break the HTTP protocol in order to alert the client about error. #68800 (Sema Checherinda).
ClickHouse now uses HTTP protocol error responses instead of exceptions to communicate errors to clients, improving HTTP compliance.

Why it matters

Exceptions disrupt the HTTP protocol by sending error messages that are not compliant with HTTP standards. This feature replaces exceptions with proper HTTP error responses, which makes error handling clearer and more consistent for HTTP clients interacting with ClickHouse.

How to use it

This behavior is enabled by default in ClickHouse's HTTP interface. Users simply interact with ClickHouse over HTTP as usual, and errors will be communicated using standard HTTP error codes and messages instead of breaking the HTTP protocol with exceptions.