dwyl/elixir-auth-google

Errors: Handle Auth Failure Conditions

Open

#16 ouverte le 29 nov. 2019

Voir sur GitHub
 (1 commentaire) (0 réactions) (1 assigné)Elixir (45 forks)github user discovery
T1dchoreenhancementhelp wantedpriority-2technical

Métriques du dépôt

Stars
 (289 stars)
Métriques de merge PR
 (Merge moyen 5h 39m) (2 PRs mergées en 30 j)

Description

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.

Guide contributeur