Skip to content

Commit 789f214

Browse files
committed
say that it's a temporal error
1 parent 076393d commit 789f214

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

core/rust/src/client.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ pub fn connect_client(
211211
runtime,
212212
}),
213213
Err(e) => {
214-
eprintln!("Error: {:?}", e);
214+
eprintln!("Error connecting to Temporal server: {:?}", e);
215215
let err_message = e.to_string().into_bytes();
216216
Err(CArray::c_repr_of(err_message).unwrap())
217217
}

core/src/Temporal/Core/Client.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,14 @@ connectClient rt conf = do
258258
case result of
259259
Left errFP -> do
260260
err <- withForeignPtr errFP $ peek >=> cArrayToText
261+
let err' = "Error connecting to Temporal server: " <> err
261262
case retryConfig conf of
262-
Nothing -> putMVar clientPtrSlot (throw $ ClientConnectionError err)
263+
Nothing -> putMVar clientPtrSlot (throw $ ClientConnectionError err')
263264
Just retryConf -> do
264265
let delayMillis = fromIntegral (initialIntervalMillis retryConf) * multiplier retryConf ^ attempt
265266
delayMicros = delayMillis * 1000
266267
if (fmap fromIntegral (maxElapsedTimeMillis retryConf) < Just delayMillis) || (maxRetries retryConf <= attempt)
267-
then putMVar clientPtrSlot (throw $ ClientConnectionError err)
268+
then putMVar clientPtrSlot (throw $ ClientConnectionError err')
268269
else do
269270
threadDelay $ round delayMicros
270271
go (attempt + 1)

0 commit comments

Comments
 (0)