cambiatus / backend

Cambiatus GraphQL API
GNU Affero General Public License v3.0
20 stars 18 forks source link

Error when accessing rich link route from browser #293

Open sentry-io[bot] opened 2 years ago

sentry-io[bot] commented 2 years ago

An error occurs when trying to access a rich link url directly from the browser (such as (https://cmbx.cambiatus.io/api/rich_link/)[https://cmbx.cambiatus.io/api/rich_link/]. This is probably due to an error while trying to assign the language into an existing atom on the rich_link_controller.ex file.

OS: Linux - OS: Manjaro 21.3.7 Ruah Browser: Firefox 103.0.2 (64-bit)


Sentry Issue: BACKEND-8D

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 120, in CambiatusWeb.RichLinkController.community_rich_link/2
  File "lib/cambiatus_web/controllers/rich_link_controller.ex", line 37, in CambiatusWeb.RichLinkController.rich_link/2
    send_resp(conn, 404, reason)
  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)