Skip to content

Commit

Permalink
Repo.delete exception not documented (#2603)
Browse files Browse the repository at this point in the history
If a row is already deleted from db Repo.delete raises Ecto.StaleEntryError.
This change docs this for the API.
  • Loading branch information
fmcgeough authored and josevalim committed Jun 22, 2018
1 parent a5508eb commit 1f4891d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ecto/repo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 928,8 @@ defmodule Ecto.Repo do
Deletes a struct using its primary key.
If the struct has no primary key, `Ecto.NoPrimaryKeyFieldError`
will be raised.
will be raised. If the struct has been removed from db prior to
call, `Ecto.StaleEntryError` will be raised.
It returns `{:ok, struct}` if the struct has been successfully
deleted or `{:error, changeset}` if there was a validation
Expand Down

0 comments on commit 1f4891d

Please sign in to comment.