Skip to content

Commit

Permalink
give better feedback on common GitHub http errors
Browse files Browse the repository at this point in the history
  • Loading branch information
brandly committed Apr 18, 2020
1 parent a5c8fd6 commit 19e5a29
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/Generators/ElmDep.elm
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,23 @@ update msg m =
, Cmd.none
)

_ ->
Err e ->
( { m
| state = Error "Couldn't connect to github."
| state =
Error <|
case e of
Http.BadStatus 404 ->
"Repo not found. Is it a private repo? Use an access token!"

Http.NetworkError ->
String.join " "
[ "Network Error."
, "This can happen when hitting GitHub's rate limits."
, "Using an access token increases these limits!"
]

_ ->
"Couldn't connect to github."
}
, Cmd.none
)
Expand Down

0 comments on commit 19e5a29

Please sign in to comment.