@@ -325,10 +325,10 @@ createThunkWithLatest target s = do
325325updateThunkToLatest :: FilePath -> IO ()
326326updateThunkToLatest target = do
327327 (overwrite, ptr) <- readThunk target >>= \case
328− Left err -> fail $ "thunk update: " <> show err
329− Right c -> return $ case c of
330− ThunkData_Packed t -> (target, t)
331− ThunkData_Checkout _ -> fail "cannot update an unpacked thunk"
328+ Left err -> failWith $ T.pack $ "thunk update: " <> show err
329+ Right c -> case c of
330+ ThunkData_Packed t -> return (target, t)
331+ ThunkData_Checkout _ -> failWith "cannot update an unpacked thunk"
332332 let src = _thunkPtr_source ptr
333333 rev <- getLatestRev src
334334 overwriteThunk overwrite $ ThunkPtr
@@ -458,7 +458,7 @@ unpackThunk thunkDir = readThunk thunkDir >>= \case
458458 mauth <- getHubAuth "github.com"
459459 repoResult <- executeRequestMaybe mauth $ repositoryR (_gitHubSource_owner s) (_gitHubSource_repo s)
460460 githubURI <- either throwIO (return . repoSshUrl) repoResult >>= \case
461− Nothing -> fail "Cannot determine clone URI for thunk source"
461+ Nothing -> failWith "Cannot determine clone URI for thunk source"
462462 Just c -> return $ T.unpack $ getUrl c
463463 withSpinner "Cloning from GitHub ..." (Just $ "Cloned " <> githubURI) $ do
464464 callProcess "hub" --TODO: Depend on hub explicitly
@@ -503,7 +503,7 @@ packThunk :: FilePath
503503 -> String
504504 -> IO ()
505505packThunk thunkDir upstream = readThunk thunkDir >>= \case
506− Left err -> fail $ "thunk pack: " <> show err
506+ Left err -> failWith $ T.pack $ "thunk pack: " <> show err
507507 Right (ThunkData_Packed _) -> failWith "pack: thunk is already packed"
508508 Right (ThunkData_Checkout _) -> do
509509 thunkPtr <- getThunkPtr thunkDir upstream
@@ -520,7 +520,7 @@ getThunkPtr thunkDir upstream = do
520520 False -> do
521521 statusDebug <- readProcess "hub"
522522 [ "-C", thunkDir, "status", "--ignored" ] ""
523− fail $ unlines $
523+ failWith $ T.pack $ unlines $
524524 [ "thunk pack: thunk checkout contains unsaved modifications"
525525 , "git status:"
526526 ] ++ lines statusDebug
@@ -530,7 +530,7 @@ getThunkPtr thunkDir upstream = do
530530 stashOutput <- readProcess "hub" [ "-C", thunkDir, "stash", "list" ] ""
531531 case null stashOutput of
532532 False -> do
533− fail $ unlines $
533+ failWith $ T.pack $ unlines $
534534 [ "thunk pack: thunk checkout has stashes"
535535 , "git stash list:"
536536 ] ++ lines stashOutput
@@ -544,7 +544,7 @@ getThunkPtr thunkDir upstream = do
544544 remotes <- lines <$> readProcess "hub" [ "-C", thunkDir, "remote" ] ""
545545 --Check that the upstream specified actually exists
546546 case L.find (== upstream) remotes of
547− Nothing -> fail $ "thunk pack: upstream " <> upstream <> " does not exist"
547+ Nothing -> failWith $ T.pack $ "thunk pack: upstream " <> upstream <> " does not exist"
548548 Just _ -> return ()
549549 -- iterate over cartesian product
550550 forM_ repoHeads $ \hd -> do
@@ -558,7 +558,7 @@ getThunkPtr thunkDir upstream = do
558558 , "remotes/" <> rm <> "/" <> hd
559559 ] ""
560560 case remoteMergeRev == localRev of
561− False -> fail $ mconcat [ "thunk unpack: branch ", hd, " has not been pushed to ", rm ]
561+ False -> failWith $ T.pack $ mconcat [ "thunk unpack: branch ", hd, " has not been pushed to ", rm ]
562562 True -> return ()
563563
564564 --We assume it's safe to pack the thunk at this point
@@ -571,7 +571,7 @@ getThunkPtr thunkDir upstream = do
571571 mRemoteUri = parseURIReference remoteUri'
572572 <|> parseSshShorthand remoteUri'
573573 thunkPtr <- case mRemoteUri of
574− Nothing -> fail uriParseFailure
574+ Nothing -> failWith $ T.pack uriParseFailure
575575 Just remoteUri -> do
576576 refs <- fmap (refsToTuples . words) . lines <$> readProcess "hub"
577577 [ "-C"
@@ -631,7 +631,7 @@ getThunkPtr thunkDir upstream = do
631631 case uriScheme u of
632632 "https:" -> return ()
633633 "git:" -> return ()
634− _ -> fail $ "thunk pack: obelisk currently only supports https and git protocols for non-GitHub remotes"
634+ _ -> failWith "thunk pack: obelisk currently only supports https and git protocols for non-GitHub remotes"
635635 $notImplemented
636636 parseSshShorthand uri' = do
637637 -- This is what git does to check that the remote