diff --git a/packages/client-common/src/utils/connection.ts b/packages/client-common/src/utils/connection.ts index 62e65eac..b505ceff 100644 --- a/packages/client-common/src/utils/connection.ts +++ b/packages/client-common/src/utils/connection.ts @@ -33,6 +33,14 @@ export function withHttpSettings( } } -export function isSuccessfulResponse(statusCode?: number): boolean { - return Boolean(statusCode && 200 <= statusCode && statusCode < 300) +export function isSuccessfulResponse( + statusCode?: number, + headers: Record = {}, +): boolean { + return Boolean( + statusCode && + 200 <= statusCode && + statusCode < 300 && + !headers['X-ClickHouse-Exception-Code'], + ) }