dwyl/elixir-auth-google

Errors: Handle Auth Failure Conditions

Open

#16 opened on 2019年11月29日

GitHub で見る
 (1 comment) (0 reactions) (1 assignee)Elixir (45 forks)github user discovery
T1dchoreenhancementhelp wantedpriority-2technical

Repository metrics

Stars
 (289 stars)
PR merge metrics
 (PR metrics pending)

説明

As a person using the @dwyl app to be more personally effective, I do not want to stumble at the first hurdle trying to authenticate. I don't expect to see unfriendly/unrecoverable error messages, rather I expect to be able to recover from errors without drama.

At present our get_token/1 function is only following the "happy path": https://github.com/dwyl/elixir-auth-google/blob/687fba552db8b5de2d353d42f77e2f04d9d428f9/lib/elixir_auth_google.ex#L18-L29

The callback function is parse_body_response/1 which does not handle the {:error, err}

https://github.com/dwyl/elixir-auth-google/blob/687fba552db8b5de2d353d42f77e2f04d9d428f9/lib/elixir_auth_google.ex#L38-L45

This is fine during MVP because as early "dogfooding" users we are tolerant of the failure/errors. But as soon as we ship and show the MVP to (friendly) alpha test users, we need to have this done.

Todo:

  • Research and document the various failure conditions and HTTP status codes
  • Add failure case statement to handle all the error conditions.
  • Update the template to ensure that error conditions are displayed in a friendly way.
  • Update instructions in README.md > How? section to inform people about error scenarios.
  • Re-publish the hex.pm package with the error handling.

We do not need to handle the failures before we ship our MVP, let's come back to this when it's needed.

コントリビューターガイド