mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-02 22:45:55 +03:00
Replace one call to permanent error function.
This commit is contained in:
parent
962c397d75
commit
560be03e85
@ -452,7 +452,7 @@ nextStep config siteMetadata mode secrets allRawResponses errors (StaticResponse
|
||||
|> List.concatMap
|
||||
(\( path, NotFetched request rawResponses ) ->
|
||||
let
|
||||
( status, continuationRequests ) =
|
||||
staticRequestsStatus =
|
||||
StaticHttpRequest.cacheRequestResolution
|
||||
ApplicationType.Cli
|
||||
request
|
||||
@ -469,10 +469,12 @@ nextStep config siteMetadata mode secrets allRawResponses errors (StaticResponse
|
||||
)
|
||||
|
||||
maybePermanentError =
|
||||
StaticHttpRequest.permanentError
|
||||
ApplicationType.Cli
|
||||
request
|
||||
usableRawResponses
|
||||
case staticRequestsStatus of
|
||||
StaticHttpRequest.HasPermanentError theError ->
|
||||
Just theError
|
||||
|
||||
_ ->
|
||||
Nothing
|
||||
|
||||
decoderErrors =
|
||||
maybePermanentError
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Pages.StaticHttpRequest exposing (Error(..), Request(..), cacheRequestResolution, permanentError, resolve, resolveUrls, strippedResponses, toBuildError, urls)
|
||||
module Pages.StaticHttpRequest exposing (Error(..), Request(..), Status(..), cacheRequestResolution, permanentError, resolve, resolveUrls, strippedResponses, toBuildError, urls)
|
||||
|
||||
import BuildError exposing (BuildError)
|
||||
import Dict exposing (Dict)
|
||||
@ -145,14 +145,15 @@ cacheRequestResolution :
|
||||
ApplicationType
|
||||
-> Request value
|
||||
-> RequestsAndPending
|
||||
-> ( Status value, List (Secrets.Value Pages.StaticHttp.Request.Request) )
|
||||
-> Status value
|
||||
cacheRequestResolution =
|
||||
cacheRequestResolutionHelp []
|
||||
|
||||
|
||||
type Status value
|
||||
= CompleteWithError Error
|
||||
| Complete value
|
||||
= Incomplete (List (Secrets.Value Pages.StaticHttp.Request.Request))
|
||||
| HasPermanentError Error
|
||||
| Complete value -- TODO include stripped responses?
|
||||
|
||||
|
||||
cacheRequestResolutionHelp :
|
||||
@ -160,7 +161,7 @@ cacheRequestResolutionHelp :
|
||||
-> ApplicationType
|
||||
-> Request value
|
||||
-> RequestsAndPending
|
||||
-> ( Status value, List (Secrets.Value Pages.StaticHttp.Request.Request) )
|
||||
-> Status value
|
||||
cacheRequestResolutionHelp foundUrls appType request rawResponses =
|
||||
case request of
|
||||
Request ( urlList, lookupFn ) ->
|
||||
@ -169,7 +170,15 @@ cacheRequestResolutionHelp foundUrls appType request rawResponses =
|
||||
cacheRequestResolutionHelp urlList appType nextRequest rawResponses
|
||||
|
||||
Err error ->
|
||||
( CompleteWithError error, urlList ++ foundUrls )
|
||||
case error of
|
||||
MissingHttpResponse string ->
|
||||
Incomplete (urlList ++ foundUrls)
|
||||
|
||||
DecoderError string ->
|
||||
HasPermanentError error
|
||||
|
||||
UserCalledStaticHttpFail string ->
|
||||
HasPermanentError error
|
||||
|
||||
Done value ->
|
||||
( Complete value, [] )
|
||||
Complete value
|
||||
|
Loading…
Reference in New Issue
Block a user