The fallback controller looks like this:
defmodule MyApiWeb.FallbackController do
@moduledoc """
Translates controller action results into valid `Plug.Conn` responses.
See `Phoenix.Controller.action_fallback/1` for more details.
"""
use MyApiWeb, :controller
def call(conn, {:error, %Ecto.Changeset{} = changeset}) do
conn
|> put_status(:unprocessable_entity)
|> render(MyApiWeb.ChangesetView, "error.json", changeset: changeset)
end
def call(conn, {:error, :not_found}) do
conn
|> put_status(:not_found)
|> render(MyApiWeb.ErrorView, :"404")
end
end
tried this {:ok, user} and i removed the fallback controller and then it gave a new error :
(exit) an exception was raised:
** (Protocol.UndefinedError) protocol String.Chars not implemented for %Stripe.Customer{account_balance: 0, business_vat_id: nil, created: 1532261740, currency: nil, default_source: nil, delinquent: false, description: "Monthly subscription", discount: nil, email: "fs@as.com", id: "cus_DHExEBEuX9Jks8", invoice_prefix: "3AB85AC", livemode: false, metadata: %{}, object: "customer", shipping: nil, sources: %Stripe.List{data: [], has_more: false, object: "list", total_count: 0, url: "/v1/customers/cus_DHExEBEuX9Jks8/sources"}, subscriptions: %Stripe.List{data: [], has_more: false, object: "list", total_count: 0, url: "/v1/customers/cus_DHExEBEuX9Jks8/subscriptions"}}
as for using the preview, i just installed phoneix a few days ago so I am not aware of using preview version.
Also I tried what khm idiot suggested and with that for the first try it went throug nicely but for the second one got the stripe user printed out and got the same fallback error