ClickHouse / clickhouse-js

Official JS client for ClickHouse DB
https://clickhouse.com
Apache License 2.0
209 stars 25 forks source link

Don't throw in Ping command #178

Closed slvrtrn closed 1 year ago

slvrtrn commented 1 year ago

It just throws if it fails to connect, which is a bit awkward.

We can either just return false on a failed attempt or change the method signature to be some variation of Either concept to allow further debugging on the application side:

type PingResult = {
  type: 'Success'
} | {
  type: 'Failure'
  error: Error
}