Skip to content

Commit

Permalink
Add more informative error message
Browse files Browse the repository at this point in the history
To splitLongPath, make it output actual filename apart from
"File name too long (cannot split)".
  • Loading branch information
ffaf1 authored and Bodigrim committed Nov 14, 2023
1 parent 665c1eb commit 242a760
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Codec/Archive/Tar/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,8 @@ splitLongPath path =
BS.empty
Right (name, first:rest) -> case packName prefixMax remainder of
Left err -> Left err
Right (_ , (_:_)) -> Left "File name too long (cannot split)"
Right (_ , (_:_)) -> Left $ "Filename " ++ path ++
" too long (cannot split)"
Right (prefix, []) -> Right $! TarPath (BS.Char8.pack name)
(BS.Char8.pack prefix)
where
Expand Down

0 comments on commit 242a760

Please sign in to comment.