mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-30 03:11:30 +03:00
Show path for which page has parse error.
This commit is contained in:
parent
436ee1e3ac
commit
077636fa62
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user