Show path for which page has parse error.

This commit is contained in:
Dillon Kearns 2019-07-23 15:53:05 -07:00
parent 436ee1e3ac
commit 077636fa62

View File

@ -95,12 +95,15 @@ buildAllData record =
Err (renderErrors errors) Err (renderErrors errors)
renderErrors : List Mark.Error.Error -> Element msg renderErrors : ( List String, List Mark.Error.Error ) -> Element msg
renderErrors errors = renderErrors ( path, errors ) =
errors Element.column []
[ Element.text (path |> String.join "/")
, errors
|> List.map (Mark.Error.toHtml Mark.Error.Light) |> List.map (Mark.Error.toHtml Mark.Error.Light)
|> List.map Element.html |> List.map Element.html
|> Element.column [] |> Element.column []
]
combineResults : combineResults :
@ -117,7 +120,7 @@ combineResults :
} }
) )
-> ->
Result (List Mark.Error.Error) Result ( List String, List Mark.Error.Error )
(List (List
( List String ( List String
, { body : List (Element msg) , { body : List (Element msg)
@ -135,9 +138,9 @@ combineResults list =
Mark.Almost partial -> Mark.Almost partial ->
-- Err "Almost" -- Err "Almost"
Err partial.errors Err ( path, partial.errors )
Mark.Failure failures -> Mark.Failure failures ->
Err failures Err ( path, failures )
) )
|> Result.Extra.combine |> Result.Extra.combine