v.23.9Improvement

Output Exception as JSON/XML in HTTP Queries with Configurable Setting

Output valid JSON/XML on excetpion during HTTP query execution. Add setting http_write_exception_in_output_format to enable/disable this behaviour (enabled by default). #52853 (Kruglov Pavel).
Output valid JSON or XML formatted error messages on exceptions during HTTP query execution in ClickHouse.

Why it matters

To improve the handling of exceptions in HTTP query executions by producing error messages formatted as valid JSON or XML. This enhancement helps clients correctly parse and handle errors, improving integration and debugging.

How to use it

Control this behavior using the setting http_write_exception_in_output_format, which is enabled by default. To disable or enable the output of error messages in valid JSON/XML format, adjust this setting accordingly.