Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when getting rich link language #298

Open
sentry-io bot opened this issue Sep 5, 2022 · 0 comments
Open

Error when getting rich link language #298

sentry-io bot opened this issue Sep 5, 2022 · 0 comments
Assignees

Comments

@sentry-io
Copy link

sentry-io bot commented Sep 5, 2022

We had an error when setting the rich link language. This happened because we try to get the accept-langauge http header and determine the language in which the rich link should be rendered. But we don't properly format this header.

We should either not get the header from the http request (since this is the only place in the app where we try to get this header) or implement it following all its specifications.


Sentry Issue: BACKEND-8F

ArgumentError: argument error
  Module "erlang", in :erlang.binary_to_existing_atom/2
  File "lib/cambiatus_web/controllers/rich_link_controller.ex", line 127, in CambiatusWeb.RichLinkController.get_language/2
  File "lib/cambiatus_web/controllers/rich_link_controller.ex", line 65, in CambiatusWeb.RichLinkController.product_rich_link/3
    case Accounts.get_user(nil, %{account: account}, nil) do
  File "lib/cambiatus_web/controllers/rich_link_controller.ex", line 25, in CambiatusWeb.RichLinkController.rich_link/2
    user_rich_link(account, community_subdomain, language)
  File "lib/cambiatus_web/controllers/rich_link_controller.ex", line 1, in CambiatusWeb.RichLinkController.action/2
    defmodule CambiatusWeb.RichLinkController do
...
(3 additional frame(s) were not displayed)

(ArgumentError argument error)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant