Closed slvrtrn closed 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 }
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: