Skip to content

Instantly share code, notes, and snippets.

@wsmoak
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wsmoak/de41ef5a710450d07170 to your computer and use it in GitHub Desktop.
Save wsmoak/de41ef5a710450d07170 to your computer and use it in GitHub Desktop.
[info] Running MyApp_802337.Endpoint with Cowboy on http://localhost:4000
02 Aug 20:58:34 - info: compiled 3 files into 2 files, copied 3 in 8060ms
[info] GET /api/tasks/1.json
[debug] Processing by MyApp_802337.TaskController.show/2
Parameters: %{"format" => "json", "id" => "1.json"}
Pipelines: [:api]
[info] Sent 400 in 456ms
[error] #PID<0.294.0> running MyApp_802337.Endpoint terminated
Server: localhost:4000 (http)
Request: GET /api/tasks/1.json
** (exit) an exception was raised:
** (Ecto.CastError) deps/ecto/lib/ecto/repo/queryable.ex:178: value `"1.json"` in `where` cannot be cast to type :id in query:
from t in MyApp_802337.Task,
where: t.id == ^"1.json"
Error when casting value to `MyApp_802337.Task.id`
(ecto) lib/ecto/query/planner.ex:89: Ecto.Query.Planner.prepare/3
(ecto) lib/ecto/query/planner.ex:68: Ecto.Query.Planner.query/3
(ecto) lib/ecto/repo/queryable.ex:17: Ecto.Repo.Queryable.all/4
(ecto) lib/ecto/repo/queryable.ex:61: Ecto.Repo.Queryable.one!/4
(my_app_802337) web/controllers/task_controller.ex:27: MyApp_802337.TaskController.show/2
(my_app_802337) web/controllers/task_controller.ex:1: MyApp_802337.TaskController.phoenix_controller_pipeline/2
(my_app_802337) lib/phoenix/router.ex:265: MyApp_802337.Router.dispatch/2
(my_app_802337) web/router.ex:1: MyApp_802337.Router.do_call/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment