dwyl/elixir-auth-google

Errors: Handle Auth Failure Conditions

Open

#16 创建于 2019年11月29日

在 GitHub 查看
 (1 评论) (0 反应) (1 负责人)Elixir (45 fork)github user discovery
T1dchoreenhancementhelp wantedpriority-2technical

仓库指标

Star
 (289 star)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南