From 242a76026198ffa938821c4324a06cd2f2c29167 Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Tue, 14 Nov 2023 15:32:49 +0100 Subject: [PATCH] Add more informative error message To splitLongPath, make it output actual filename apart from "File name too long (cannot split)". --- Codec/Archive/Tar/Types.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Codec/Archive/Tar/Types.hs b/Codec/Archive/Tar/Types.hs index cf16dc6..260bbdb 100644 --- a/Codec/Archive/Tar/Types.hs +++ b/Codec/Archive/Tar/Types.hs @@ -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