Commit 9dfec964 authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

review: remove call to traceStack

parent 0e73b8d7
......@@ -67,3 +67,8 @@ src/Async/Worker.hs:277:22: error: [-Wredundant-constraints, -Werror=redundant-c
277 | mkDefaultSendJob' :: HasWorkerBroker b a
|
```
# Do not use `Debug.Trace` logging in library code
As the name implies, `Debug.Trace` & co are really only for debugging purposes, and is not recommended
to leave them in library code, `traceStack` being a primary example.
......@@ -41,7 +41,6 @@ import Control.Concurrent.STM (atomically)
import Control.Concurrent.STM.TVar (readTVarIO, newTVarIO, writeTVar)
import Control.Exception.Safe (catches, Handler(..), throwIO, SomeException, Exception)
import Control.Monad (forever, void, when)
import Debug.Trace (traceStack)
import System.Timeout qualified as Timeout
......@@ -223,9 +222,7 @@ handleJobError _state@(State { .. }) brokerMessage = do
void $ sendJob broker queueName (job { metadata = mdata { readCount = readCt + 1 } })
handleUnknownError :: State b a -> SomeException -> IO ()
handleUnknownError state err = do
let _ = traceStack ("unknown error: " <> show err)
putStrLn $ formatStr state $ "unknown error: " <> show err
handleUnknownError state err = putStrLn $ formatStr state $ "unknown error: " <> show err
sendJob :: (HasWorkerBroker b a) => Broker b (Job a) -> Queue -> Job a -> IO (MessageId b)
sendJob broker queueName job = do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment