about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsternenseemann <git@lukasepple.de>2017-09-26 23:51:55 +0200
committersternenseemann <git@lukasepple.de>2017-09-27 00:01:03 +0200
commitba8f55f522ef336dc2983feba3ef01a15af112a6 (patch)
treefea039e060312d5f4cf041b68e3e073522d46096
parent2cb7136674f6b810ad2a63404a722456bd53ec98 (diff)
Increase amount of temp files and make error message better
-rw-r--r--backend/Main.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/backend/Main.hs b/backend/Main.hs
index 9874105..6ba476b 100644
--- a/backend/Main.hs
+++ b/backend/Main.hs
@@ -84,8 +84,8 @@ synthWav midi = do
 
 tempFile :: String -> Handler FilePath
 tempFile ext = try 0
-  where maxtries = 100
-        try :: Integer -> Handler FilePath
+  where maxtries = maxBound
+        try :: Int -> Handler FilePath
         try n
           | n < maxtries = do
             progName <- liftIO $ getProgName
@@ -94,7 +94,7 @@ tempFile ext = try 0
             if exists
               then try (n + 1)
               else pure path
-          | otherwise = throwError err500
+          | otherwise = throwError err500 { errBody = "no temp files" }
 app :: Application
 app = serve api server