Commit 35bbbf08 authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[async tasks] fix error reporting for async tasks, add 0.14.4 PS for CI

parent 1c46c74a
......@@ -25,7 +25,7 @@ test:
script:
# find 0.14.2 purescript version here:
# https://lazamar.co.uk/nix-versions/
- nix-env -i purescript-0.14.2 -f https://github.com/NixOS/nixpkgs/archive/bed08131cd29a85f19716d9351940bdc34834492.tar.gz
- nix-env -i purescript-0.14.4 -f https://github.com/NixOS/nixpkgs/archive/bed08131cd29a85f19716d9351940bdc34834492.tar.gz
- nix-env -i git
- nix-env -i nodejs
- nix-env -i yarn
......
......@@ -5,6 +5,7 @@ import Gargantext.Prelude
import Data.Array as A
import Data.Either (Either(..))
import Data.Foldable (foldl)
import Data.Maybe (fromMaybe)
import Effect (Effect)
import Effect.Aff (Aff)
import Effect.Class (liftEffect)
......@@ -41,7 +42,7 @@ handleErrorInAsyncProgress errors ap@(AsyncProgress { log, status: IsFinished })
handleErrorInAsyncProgress _ _ = pure unit
concatErrors :: AsyncProgress -> String
concatErrors (AsyncProgress { log }) = foldl eventsErrorMessage "" log
concatErrors (AsyncProgress { error, log }) = foldl eventsErrorMessage (fromMaybe "" error) log
where
eventsErrorMessage acc (AsyncTaskLog { events }) = (foldl eventErrorMessage "" events) <> "\n" <> acc
eventErrorMessage acc (AsyncEvent { level: "ERROR", message }) = message <> "\n" <> acc
......
......@@ -737,6 +737,7 @@ instance Eq AsyncTaskWithType where eq = genericEq
newtype AsyncProgress = AsyncProgress
{ id :: AsyncTaskID
, error :: Maybe String
, log :: Array AsyncTaskLog
, status :: AsyncTaskStatus
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment