So when a changeset is invalid, Ecto returns an Ecto.InvalidChangesetError. This is what should be used instead of @type validation_errors :: {:error, Ecto.Changeset.t}, as otherwise you have to do changeset.changeset, like as follows:
def handle_create(_conn, attributes) do
try do
post = Post.create(attributes)
{:ok, post} = post
rescue
changeset in [Ecto.InvalidChangesetError] -> {:error, changeset.changeset}
end
end