where
import Codec.Binary.UTF8.String
-import Control.Exception
import Control.Monad
import Data.List
import qualified Data.Map as M
import Rakka.SystemConfig
import Rakka.Utils
import Rakka.W3CDateTime
-import Subversion.Error
import Subversion.FileSystem
import Subversion.FileSystem.DirEntry
import Subversion.FileSystem.Revision
putPageIntoRepository :: Repository -> Maybe String -> Page -> IO StatusCode
putPageIntoRepository repos userID page
- = filterSvnError $
- do let name = pageName page
+ = do let name = pageName page
author = fromMaybe "[Rakka]" userID
case pageUpdateInfo page of
Just ui
deletePageFromRepository :: Repository -> Maybe String -> PageName -> IO StatusCode
deletePageFromRepository repos userID name
- = filterSvnError $
- do let pagePath = mkPagePath name
+ = do let pagePath = mkPagePath name
attachmentPath = mkAttachmentDirPath name
fs <- getRepositoryFS repos
rev <- getYoungestRev fs
-> a
-> IO StatusCode
putAttachmentIntoRepository repos userID oldRev pName aName attachment
- = filterSvnError $
- do let author = fromMaybe "[Rakka]" userID
+ = do let author = fromMaybe "[Rakka]" userID
path = mkAttachmentPath pName aName
fs <- getRepositoryFS repos
oldRev' <- case oldRev of
case ret of
Left _ -> return Conflict
Right _ -> return NoContent
-
-
-filterSvnError :: IO a -> IO a
-filterSvnError f = catchDyn f rethrow
- where
- rethrow :: SvnError -> IO a
- rethrow err
- = let code = svnErrCode err
- msg = svnErrMsg err
- in
- fail $ "SvnError: " ++ show code ++ ": " ++ msg