@@ -130,7 +130,7 @@ data Diff
130 | DiffUnpublished
130 | DiffUnpublished
131 | DiffUnknownPackage Pkg.Name [Pkg.Name]
131 | DiffUnknownPackage Pkg.Name [Pkg.Name]
132 | DiffUnknownVersion Pkg.Name V.Version [V.Version]
132 | DiffUnknownVersion Pkg.Name V.Version [V.Version]
133− | DiffDocsProblem DocsProblem
133+ | DiffDocsProblem V.Version DocsProblem
134 | DiffMustHaveLatestRegistry RegistryProblem
134 | DiffMustHaveLatestRegistry RegistryProblem
135 | DiffBadDetails Details
135 | DiffBadDetails Details
136 | DiffBadBuild BuildProblem
136 | DiffBadBuild BuildProblem
@@ -198,8 +198,9 @@ diffToReport diff =
198 , "Want one of those instead?"
198 , "Want one of those instead?"
201− DiffDocsProblem problem ->
201+ DiffDocsProblem version problem ->
202− error "TODO DiffDocsProblem" problem
202+ toDocsProblemReport problem $
203+ "I need the docs for " ++ V.toChars version ++ " to compute this diff"
204 DiffMustHaveLatestRegistry problem ->
205 DiffMustHaveLatestRegistry problem ->
205 toRegistryProblemReport "PROBLEM UPDATING PACKAGE LIST" problem $
206 toRegistryProblemReport "PROBLEM UPDATING PACKAGE LIST" problem $
@@ -266,8 +267,9 @@ bumpToReport bump =
266 toRegistryProblemReport "PROBLEM UPDATING PACKAGE LIST" problem $
267 toRegistryProblemReport "PROBLEM UPDATING PACKAGE LIST" problem $
267 "I need the latest list of published packages before I can bump any versions"
268 "I need the latest list of published packages before I can bump any versions"
269− BumpCannotFindDocs name version problem ->
270+ BumpCannotFindDocs _ version problem ->
270− error "TODO BumpCannotFindDocs" name version problem
271+ toDocsProblemReport problem $
272+ "I need the docs for " ++ V.toChars version ++ " to compute the next version number"
@@ -317,7 +319,7 @@ data Publish
317 | PublishCannotGetTag Http.Error
319 | PublishCannotGetTag Http.Error
318 | PublishCannotGetZip Http.Error
320 | PublishCannotGetZip Http.Error
319 | PublishCannotDecodeZip
321 | PublishCannotDecodeZip
320− | PublishCannotGetDocs DocsProblem
322+ | PublishCannotGetDocs V.Version V.Version DocsProblem
321 | PublishCannotRegister Http.Error
323 | PublishCannotRegister Http.Error
322 | PublishMissingTag V.Version
324 | PublishMissingTag V.Version
323 | PublishNoGit
325 | PublishNoGit
@@ -491,8 +493,10 @@ publishToReport publish =
491 PublishCannotDecodeZip ->
493 PublishCannotDecodeZip ->
492 error "TODO PublishCannotDecodeZip"
494 error "TODO PublishCannotDecodeZip"
494− PublishCannotGetDocs docsProblem ->
496+ PublishCannotGetDocs old new docsProblem ->
495− error "TODO PublishCannotGetDocs" docsProblem
497+ toDocsProblemReport docsProblem $
498+ "I need the docs for " ++ V.toChars old ++ " to verify that "
499+ ++ V.toChars new ++ " really does come next"
497 PublishCannotRegister httpError ->
501 PublishCannotRegister httpError ->
498 error "TODO PublishCannotRegister" httpError
502 error "TODO PublishCannotRegister" httpError
@@ -587,10 +591,44 @@ toBadReadmeReport title summary =
588data DocsProblem
592data DocsProblem
589 = DP_Http Http.Error
593 = DP_Http Http.Error
590− | DP_Data
594+ | DP_Data String BS.ByteString
591 | DP_Cache
595 | DP_Cache
598+toDocsProblemReport :: DocsProblem -> String -> Help.Report
599+toDocsProblemReport problem context =
601+ DP_Http httpError ->
602+ toHttpErrorReport "PROBLEM FETCHING DOCS" httpError context
605+ Help.report "PROBLEM FETCHING DOCS" Nothing (context ++ ", so I fetched:")
606+ [ D.indent 4 $ D.dullyellow $ D.fromChars url
608+ "I got the data back, but it was not what I was expecting. The response\
609+ \ body contains " ++ show (BS.length body) ++ " bytes. Here is the "
610+ ++ if BS.length body <= 76 then "whole thing:" else "beginning:"
611+ , D.indent 4 $ D.dullyellow $ D.fromChars $
612+ if BS.length body <= 76
613+ then BS_UTF8.toString body
614+ else take 73 (BS_UTF8.toString body) ++ "..."
616+ "Does this error keep showing up? Maybe there is something weird with your\
617+ \ internet connection. We have gotten reports that schools, businesses,\
618+ \ airports, etc. sometimes intercept requests and add things to the body\
619+ \ or change its contents entirely. Could that be the problem?"
623+ Help.report "PROBLEM LOADING DOCS" Nothing (context ++ ", but the local copy seems to be corrupted.")
625+ "I deleted the cached version, so the next run should download a fresh copy of\
626+ \ the docs. Hopefully that will get you unstuck, but it will not resolve the root\
627+ \ problem if, for example, a 3rd party editor plugin is modifing cached files\
595-- INSTALL
633-- INSTALL
@@ -793,7 +831,7 @@ toHttpErrorReport title err context =
793 , D.indent 4 $ D.fromChars reason
831 , D.indent 4 $ D.fromChars reason
794 , D.reflow $
832 , D.reflow $
795 "This may indicate that there is some problem in the compiler, so please open an\
833 "This may indicate that there is some problem in the compiler, so please open an\
796− \ issue at https://github.com/elm/compiler/issues listing your operating system\
834+ \ issue at https://github.com/elm/compiler/issues listing your operating system, Elm\
797 \ version, the command you ran, the terminal output, and any additional information\
835 \ version, the command you ran, the terminal output, and any additional information\
798 \ that might help others reproduce the error."
836 \ that might help others reproduce the error."