dwyl / dwyl/elixir-auth-google

Errors: Handle Auth Failure Conditions

Open
#16 1 comment 0 reactions 1 assignee Claimed by @SimonLab View on GitHub
chore enhancement help wanted priority-2 T1d technical
Dominant language
Elixir
Stars
290
Forks
46
PR merge metrics
No merged PRs in 30d

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"](https://en.wikipedia.org/wiki/Eating_your_own_dog_food) 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.