@@ -1145,8 +1145,8 @@ toDetailsReport details =
11451145 toRegistryProblemReport "PROBLEM LOADING PACKAGE LIST" problem $
11461146 "I need the list of published packages to figure out if your project has compatible dependencies"
11471147
1148− DetailsCannotBuildPackage name version problem ->
1149− error "TODO DetailsCannotBuildPackage" name version problem
1148+ DetailsCannotBuildPackage pkg vsn problem ->
1149+ toPackageProblemReport pkg vsn problem
11501150
11511151
11521152
@@ -1155,10 +1155,68 @@ toDetailsReport details =
11551155
11561156data PackageProblem
11571157 = PP_BadEndpointRequest Http.Error
1158− | PP_BadEndpointContent
1158+ | PP_BadEndpointContent String
11591159 | PP_BadArchiveRequest Http.Error
1160− | PP_BadArchiveContent
1161− | PP_BadArchiveHash String String
1160+ | PP_BadArchiveContent String
1161+ | PP_BadArchiveHash String String String
1162+
1163+
1164+toPackageProblemReport :: Pkg.Name -> V.Version -> PackageProblem -> Help.Report
1165+toPackageProblemReport pkg vsn problem =
1166+ let
1167+ thePackage =
1168+ Pkg.toChars pkg ++ " " ++ V.toChars vsn
1169+ in
1170+ case problem of
1171+ PP_BadEndpointRequest httpError ->
1172+ toHttpErrorReport "PROBLEM DOWNLOADING PACKAGE" httpError $
1173+ "I need to find the latest download link for " ++ thePackage
1174+
1175+ PP_BadEndpointContent url ->
1176+ Help.report "PROBLEM DOWNLOADING PACKAGE" Nothing
1177+ (
1178+ "I need to find the latest download link for " ++ thePackage ++ ", but I ran into corrupted information from:"
1179+ )
1180+ [ D.indent 4 $ D.dullyellow $ D.fromChars url
1181+ , D.reflow $
1182+ "Is something weird with your internet connection. We have gotten reports that\
1183+ \ schools, businesses, airports, etc. sometimes intercept requests and add things\
1184+ \ to the body or change its contents entirely. Could that be the problem?"
1185+ ]
1186+
1187+ PP_BadArchiveRequest httpError ->
1188+ toHttpErrorReport "PROBLEM DOWNLOADING PACKAGE" httpError $
1189+ "I was trying to download the source code for " ++ thePackage
1190+
1191+ PP_BadArchiveContent url ->
1192+ Help.report "PROBLEM DOWNLOADING PACKAGE" Nothing
1193+ (
1194+ "I downloaded the source code for " ++ thePackage ++ " from:"
1195+ )
1196+ [ D.indent 4 $ D.dullyellow $ D.fromChars url
1197+ , D.reflow $
1198+ "But I was unable to unzip the data. Maybe there is something weird with\
1199+ \ your internet connection. We have gotten reports that schools, businesses,\
1200+ \ airports, etc. sometimes intercept requests and add things to the body or\
1201+ \ change its contents entirely. Could that be the problem?"
1202+ ]
1203+
1204+ PP_BadArchiveHash url expectedHash actualHash ->
1205+ Help.report "CORRUPT PACKAGE DATA" Nothing
1206+ (
1207+ "I downloaded the source code for " ++ thePackage ++ " from:"
1208+ )
1209+ [ D.indent 4 $ D.dullyellow $ D.fromChars url
1210+ , D.reflow "But it looks like the hash of the archive has changed since publication:"
1211+ , D.vcat $ map D.fromChars $
1212+ [ " Expected: " ++ expectedHash
1213+ , " Actual: " ++ actualHash
1214+ ]
1215+ , D.reflow $
1216+ "This usually means that the package author moved the version\
1217+ \ tag, so report it to them and see if that is the issue. Folks\
1218+ \ on Elm slack can probably help as well."
1219+ ]
11621220
11631221
11641222