diff --git a/src/TaskMachine/LTask.hs b/src/TaskMachine/LTask.hs index 9045b57..c2ae64d 100644 --- a/src/TaskMachine/LTask.hs +++ b/src/TaskMachine/LTask.hs @@ -66,9 +66,7 @@ data ErrorAction loadErrorMessage :: IOError -> Maybe ErrorAction loadErrorMessage e | isDoesNotExistError e = Just IgnoreError - | isIllegalOperation e = Just $ ErrorMessage $ "Could not open file:\n" ++ show e - | isPermissionError e = Just $ ErrorMessage "Could not open file: Permission denied" - | otherwise = Nothing + | otherwise = Just $ ErrorMessage $ show e loadLTasks :: FilePath -> IO (Either String (V.Vector LTask)) loadLTasks file = do @@ -78,18 +76,11 @@ loadLTasks file = do Left (ErrorMessage msg) -> pure $ Left msg Right (Left parseError) -> pure $ Left $ parseErrorPretty parseError Right (Right taskList) -> pure $ Right $ V.fromList $ fromTasks taskList - --Left parseError -> pure $ Left $ parseErrorPretty parseError - --Right taskList -> pure $ Right $ V.fromList $ fromTasks taskList {- Saving -} saveErrorMessage :: IOError -> Maybe String -saveErrorMessage e - | isAlreadyInUseError e = Just "Could not save to file: File already in use" - | isFullError e = Just "Could not save to file: Disk full" - | isIllegalOperation e = Just $ "Could not save to file:\n" ++ show e - | isPermissionError e = Just "Could not save to file: Permission denied" - | otherwise = Nothing +saveErrorMessage e = Just $ show e saveLTasks :: FilePath -> V.Vector LTask -> IO (Either String ()) saveLTasks file ltasks = do diff --git a/todo.txt b/todo.txt index 5bb40d2..393be5b 100644 --- a/todo.txt +++ b/todo.txt @@ -19,5 +19,5 @@ x2018-10-24 c2018-10-24 Reverse ordering of completed tasks - most recent at the - c2018-10-26 Move C - cleanup to F - fixup - c2018-10-26 Add "starting" task type (start date, prio, due date, description) - c2018-10-26 Add "formula" task type (formula, prio, due date, description) - maybe due date formula? -- (D) c2018-10-26 Fix crash on attempting to open a folder +x2018-11-01 (D) c2018-10-26 Fix crash on attempting to open a folder - c2018-10-26 Think of something to do with +project tags, @context tags and key:value tags