@@ -316,12 +316,13 @@ data Publish
316316 | PublishShortReadme
317317 | PublishNoLicense
318318 | PublishBuildProblem BuildProblem
319− | PublishCannotGetTag Http.Error
319+ | PublishMissingTag V.Version
320+ | PublishCannotGetTag V.Version Http.Error
321+ | PublishCannotGetTagData V.Version String BS.ByteString
320322 | PublishCannotGetZip Http.Error
321323 | PublishCannotDecodeZip
322324 | PublishCannotGetDocs V.Version V.Version DocsProblem
323325 | PublishCannotRegister Http.Error
324− | PublishMissingTag V.Version
325326 | PublishNoGit
326327 | PublishLocalChanges V.Version
327328 --
@@ -484,23 +485,6 @@ publishToReport publish =
484485 PublishBuildProblem buildProblem ->
485486 error "TODO PublishBuildProblem" buildProblem
486487
487− PublishCannotGetTag httpError ->
488− error "TODO PublishCannotGetTag" httpError
489−
490− PublishCannotGetZip httpError ->
491− error "TODO PublishCannotGetZip" httpError
492−
493− PublishCannotDecodeZip ->
494− error "TODO PublishCannotDecodeZip"
495−
496− PublishCannotGetDocs old new docsProblem ->
497− toDocsProblemReport docsProblem $
498− "I need the docs for " ++ V.toChars old ++ " to verify that "
499− ++ V.toChars new ++ " really does come next"
500−
501− PublishCannotRegister httpError ->
502− error "TODO PublishCannotRegister" httpError
503−
504488 PublishMissingTag version ->
505489 let vsn = V.toChars version in
506490 Help.docReport "NO TAG" Nothing
@@ -520,6 +504,59 @@ publishToReport publish =
520504 , "The -m flag is for a helpful message. Try to make it more informative!"
521505 ]
522506
507+ PublishCannotGetTag version httpError ->
508+ case httpError of
509+ Http.BadHttp _ (HTTP.StatusCodeException response _)
510+ | HTTP.statusCode (HTTP.responseStatus response) == 404 ->
511+ let vsn = V.toChars version in
512+ Help.report "NO TAG ON GITHUB" Nothing
513+ ("You have version " ++ vsn ++ " tagged locally, but not on GitHub.")
514+ [ D.reflow
515+ "Run the following command to make this tag available on GitHub:"
516+ , D.indent 4 $ D.dullyellow $ D.fromChars $
517+ "git push origin " ++ vsn
518+ , D.reflow
519+ "This will make it possible to find your code online based on the version number."
520+ ]
521+
522+ _ ->
523+ toHttpErrorReport "PROBLEM VERIFYING TAG" httpError
524+ "I need to check that the version tag is registered on GitHub"
525+
526+ PublishCannotGetTagData version url body ->
527+ Help.report "PROBLEM VERIFYING TAG" Nothing
528+ ("I need to check that version " ++ V.toChars version ++ " is tagged on GitHub, so I fetched:")
529+ [ D.indent 4 $ D.dullyellow $ D.fromChars url
530+ , D.reflow $
531+ "I got the data back, but it was not what I was expecting. The response\
532+ \ body contains " ++ show (BS.length body) ++ " bytes. Here is the "
533+ ++ if BS.length body <= 76 then "whole thing:" else "beginning:"
534+ , D.indent 4 $ D.dullyellow $ D.fromChars $
535+ if BS.length body <= 76
536+ then BS_UTF8.toString body
537+ else take 73 (BS_UTF8.toString body) ++ "..."
538+ , D.reflow $
539+ "Does this error keep showing up? Maybe there is something weird with your\
540+ \ internet connection. We have gotten reports that schools, businesses,\
541+ \ airports, etc. sometimes intercept requests and add things to the body\
542+ \ or change its contents entirely. Could that be the problem?"
543+ ]
544+
545+ PublishCannotGetZip httpError ->
546+ toHttpErrorReport "PROBLEM DOWNLOADING CODE" httpError $
547+ "I need to check that folks can download and build the source code when they install this package"
548+
549+ PublishCannotDecodeZip ->
550+ error "TODO PublishCannotDecodeZip"
551+
552+ PublishCannotGetDocs old new docsProblem ->
553+ toDocsProblemReport docsProblem $
554+ "I need the docs for " ++ V.toChars old ++ " to verify that "
555+ ++ V.toChars new ++ " really does come next"
556+
557+ PublishCannotRegister httpError ->
558+ error "TODO PublishCannotRegister" httpError
559+
523560 PublishNoGit ->
524561 Help.report "NO GIT" Nothing
525562 "I searched your PATH environment variable for `git` and could not\
@@ -599,10 +636,10 @@ toDocsProblemReport :: DocsProblem -> String -> Help.Report
599636toDocsProblemReport problem context =
600637 case problem of
601638 DP_Http httpError ->
602− toHttpErrorReport "PROBLEM FETCHING DOCS" httpError context
639+ toHttpErrorReport "PROBLEM LOADING DOCS" httpError context
603640
604641 DP_Data url body ->
605− Help.report "PROBLEM FETCHING DOCS" Nothing (context ++ ", so I fetched:")
642+ Help.report "PROBLEM LOADING DOCS" Nothing (context ++ ", so I fetched:")
606643 [ D.indent 4 $ D.dullyellow $ D.fromChars url
607644 , D.reflow $
608645 "I got the data back, but it was not what I was expecting. The response\