Skip to content

Commit

Permalink
Fix debug ignoring log tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewMacmurray committed Mar 15, 2024
1 parent 553a371 commit 2cb130f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions examples/many-requests/src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ longRequest ms =
, expect = Http.expectJson (Decode.field "message" Decode.string)
, timeout = Nothing
}
|> Task.debug Debug.toString Debug.toString


sometimesFails : ConcurrentTask Http.Error String
Expand All @@ -123,6 +124,7 @@ sometimesFails =
, expect = Http.expectJson (Decode.field "message" Decode.string)
, timeout = Nothing
}
|> Task.debug Debug.toString Debug.toString


httpError : ConcurrentTask Http.Error String
Expand All @@ -133,6 +135,7 @@ httpError =
, expect = Http.expectJson (Decode.field "message" Decode.string)
, timeout = Nothing
}
|> Task.debug Debug.toString Debug.toString


{-| Simple retry mechanism with backoff
Expand Down
4 changes: 2 additions & 2 deletions src/ConcurrentTask.elm
Original file line number Diff line number Diff line change
Expand Up @@ -688,13 +688,13 @@ debug toOk toErr task =
(\a ->
toOk a
|> debugLog "Success"
|> (\_ -> succeed a)
|> return a
)
|> onError
(\x ->
toErr x
|> debugLog "Failure"
|> (\_ -> fail x)
|> andThenDo (fail x)
)


Expand Down

0 comments on commit 2cb130f

Please sign in to comment.