aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-01-25 18:26:14 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2016-01-25 18:26:14 +0000
commite9cc80873498ba63469f9730d79846e5944aba06 (patch)
treed8a954be688f5c50f181f38c41a651a01f4679cf
parentf706b4e7fad48712e2032e27efb1318326db2569 (diff)
downloadthermoprint-e9cc80873498ba63469f9730d79846e5944aba06.tar
thermoprint-e9cc80873498ba63469f9730d79846e5944aba06.tar.gz
thermoprint-e9cc80873498ba63469f9730d79846e5944aba06.tar.bz2
thermoprint-e9cc80873498ba63469f9730d79846e5944aba06.tar.xz
thermoprint-e9cc80873498ba63469f9730d79846e5944aba06.zip
did some thinking on exception handling
-rw-r--r--server/src/Thermoprint/Server/Printer.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/src/Thermoprint/Server/Printer.hs b/server/src/Thermoprint/Server/Printer.hs
index 5b1b7b0..55bfabc 100644
--- a/server/src/Thermoprint/Server/Printer.hs
+++ b/server/src/Thermoprint/Server/Printer.hs
@@ -92,7 +92,7 @@ runPrinter Printer{..} = forever $ do
92 Nothing -> $(logWarn) "Nonexistent job id in printer queue" 92 Nothing -> $(logWarn) "Nonexistent job id in printer queue"
93 Just job -> do 93 Just job -> do
94 $(logInfo) . T.pack $ "Printing " ++ show (unSqlBackendKey . unJobKey $ jobId) 94 $(logInfo) . T.pack $ "Printing " ++ show (unSqlBackendKey . unJobKey $ jobId)
95 printReturn <- (unPM print) (jobContent job) 95 printReturn <- (unPM print) (jobContent job) -- We could, at this point, do some exception handling. It was decided that this would be undesirable, because we really don't have any idea what exceptions to catch
96 maybe (return ()) ($(logWarn) . T.pack . (("Error while printing " ++ show (unSqlBackendKey . unJobKey $ jobId) ++ ": ") ++) . show) $ printReturn 96 maybe (return ()) ($(logWarn) . T.pack . (("Error while printing " ++ show (unSqlBackendKey . unJobKey $ jobId) ++ ": ") ++) . show) $ printReturn
97 atomically' $ modifyTVar' queue (\Queue{..} -> force . Queue pending Nothing $ (jobId, printReturn) <| history) 97 atomically' $ modifyTVar' queue (\Queue{..} -> force . Queue pending Nothing $ (jobId, printReturn) <| history)
98 98