on master help sign in
give more info when HTTP fails with bad status code
ba1c3d7Evan Czaplicki
builder/src/Reporting/Exit.hs+2−1
@@ -1522,7 +1522,7 @@ toHttpErrorReport title err context =
1522
1522
1523 Http.BadHttp url httpExceptionContent ->
1523 Http.BadHttp url httpExceptionContent ->
1524 case httpExceptionContent of
1524 case httpExceptionContent of
1525− HTTP.StatusCodeException response _ ->
1525+ HTTP.StatusCodeException response body ->
1526 let
1526 let
1527 (HTTP.Status code message) = HTTP.responseStatus response
1527 (HTTP.Status code message) = HTTP.responseStatus response
1528 in
1528 in
@@ -1530,6 +1530,7 @@ toHttpErrorReport title err context =
1530 [ D.fillSep $
1530 [ D.fillSep $
1531 ["But","it","came","back","as",D.red (D.fromInt code)]
1531 ["But","it","came","back","as",D.red (D.fromInt code)]
1532 ++ map D.fromChars (words (BS_UTF8.toString message))
1532 ++ map D.fromChars (words (BS_UTF8.toString message))
1533+ , D.indent 4 $ D.reflow $ BS_UTF8.toString body
1533 , D.reflow $
1534 , D.reflow $
1534 "This may mean some online endpoint changed in an unexpected way, so if does not\
1535 "This may mean some online endpoint changed in an unexpected way, so if does not\
1535 \ seem like something on your side is causing this (e.g. firewall) please report\
1536 \ seem like something on your side is causing this (e.g. firewall) please report\