on master help sign in
add more error messages
d69d1e2Evan Czaplicki
builder/src/Reporting/Exit.hs+40−7
@@ -220,7 +220,7 @@ diffToReport diff =
220 "I need the latest list of published packages before I do this diff"
220 "I need the latest list of published packages before I do this diff"
221
221
222 DiffBadDetails details ->
222 DiffBadDetails details ->
223− error "TODO DiffBadDetails" details
223+ toDetailsReport details
224
224
225 DiffBadBuild buildProblem ->
225 DiffBadBuild buildProblem ->
226 error "TODO DiffBadBuild" buildProblem
226 error "TODO DiffBadBuild" buildProblem
@@ -360,7 +360,7 @@ publishToReport publish =
360 toOutlineReport outline
360 toOutlineReport outline
361
361
362 PublishBadDetails problem ->
362 PublishBadDetails problem ->
363− error "TODO PublishBadDetails" problem
363+ toDetailsReport problem
364
364
365 PublishMustHaveLatestRegistry problem ->
365 PublishMustHaveLatestRegistry problem ->
366 toRegistryProblemReport "PROBLEM UPDATING PACKAGE LIST" problem $
366 toRegistryProblemReport "PROBLEM UPDATING PACKAGE LIST" problem $
@@ -496,7 +496,7 @@ publishToReport publish =
496 ]
496 ]
497
497
498 PublishBuildProblem buildProblem ->
498 PublishBuildProblem buildProblem ->
499− error "TODO PublishBuildProblem" buildProblem
499+ toBuildProblemReport buildProblem
500
500
501 PublishMissingTag version ->
501 PublishMissingTag version ->
502 let vsn = V.toChars version in
502 let vsn = V.toChars version in
@@ -1113,10 +1113,32 @@ toDetailsReport :: Details -> Help.Report
1113toDetailsReport details =
1113toDetailsReport details =
1114 case details of
1114 case details of
1115 DetailsNoSolution ->
1115 DetailsNoSolution ->
1116− error "TODO DetailsNoSolution"
1116+ Help.report "INCOMPATIBLE DEPENDENCIES" (Just "elm.json")
1117+ "The dependencies in your elm.json are not compatible."
1118+ [ D.fillSep
1119+ ["Did","you","change","them","by","hand?","Try","to","change","it","back!"
1120+ ,"It","is","much","more","reliable","to","add","dependencies","with",D.green "elm install"
1121+ ,"or","the","dependency","management","tool","in",D.green "elm reactor" <> "."
1122+ ]
1123+ , D.reflow $
1124+ "Please ask for help on the community forums if you try those paths and are still\
1125+ \ having problems!"
1126+ ]
1117
1127
1118 DetailsNoOfflineSolution ->
1128 DetailsNoOfflineSolution ->
1119− error "TODO DetailsNoOfflineSolution"
1129+ Help.report "TROUBLE VERIFYING DEPENDENCIES" (Just "elm.json")
1130+ "I could not connect to https://package.elm-lang.org to get the latest list of\
1131+ \ packages, and I was unable to verify your dependencies with the information I\
1132+ \ have cached locally."
1133+ [ D.reflow $
1134+ "Are you able to connect to the internet? These dependencies may work once you\
1135+ \ get access to the registry!"
1136+ , D.toFancyNote
1137+ ["If","you","changed","your","dependencies","by","hand,","try","to","change","them","back!"
1138+ ,"It","is","much","more","reliable","to","add","dependencies","with",D.green "elm install"
1139+ ,"or","the","dependency","management","tool","in",D.green "elm reactor" <> "."
1140+ ]
1141+ ]
1120
1142
1121 DetailsSolverProblem _ ->
1143 DetailsSolverProblem _ ->
1122 error "TODO DetailsSolverProblem"
1144 error "TODO DetailsSolverProblem"
@@ -1145,14 +1167,25 @@ toDetailsReport details =
1145 ]
1167 ]
1146
1168
1147 DetailsHandEditedDependencies ->
1169 DetailsHandEditedDependencies ->
1148− error "TODO DetailsHandEditedDependencies"
1170+ Help.report "ERROR IN DEPENDENCIES" (Just "elm.json")
1171+ "It looks like the dependencies elm.json in were edited by hand (or by a 3rd\
1172+ \ party tool) leaving them in an invalid state."
1173+ [ D.fillSep
1174+ ["Try","to","change","them","back","to","what","they","were","before!"
1175+ ,"It","is","much","more","reliable","to","add","dependencies","with",D.green "elm install"
1176+ ,"or","the","dependency","management","tool","in",D.green "elm reactor" <> "."
1177+ ]
1178+ , D.reflow $
1179+ "Please ask for help on the community forums if you try those paths and are still\
1180+ \ having problems!"
1181+ ]
1149
1182
1150 DetailsBadOutline outline ->
1183 DetailsBadOutline outline ->
1151 toOutlineReport outline
1184 toOutlineReport outline
1152
1185
1153 DetailsCannotGetRegistry problem ->
1186 DetailsCannotGetRegistry problem ->
1154 toRegistryProblemReport "PROBLEM LOADING PACKAGE LIST" problem $
1187 toRegistryProblemReport "PROBLEM LOADING PACKAGE LIST" problem $
1155− "I need the list of published packages to figure out if your project has compatible dependencies"
1188+ "I need the list of published packages to verify your dependencies"
1156
1189
1157 DetailsCannotBuildPackage pkg vsn problem ->
1190 DetailsCannotBuildPackage pkg vsn problem ->
1158 toPackageProblemReport pkg vsn problem
1191 toPackageProblemReport pkg vsn problem