Skip to content

Commit

Permalink
Document error behavior for Oban.insert_all/3 (#934)
Browse files Browse the repository at this point in the history
* Document error behavior for Oban.insert_all/3
  • Loading branch information
Aleksandr Lossenko authored Aug 1, 2023
1 parent de38823 commit 2f548b0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/oban.ex
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,16 @@ defmodule Oban do
1. This function always returns a list rather than a tuple of `{count, records}`
2. This function accepts a list of changesets rather than a list of maps or keyword lists
#### Error Handling and Rollbacks
If `insert_all` encounters an issue, the function will raise an error based on your database
adapter. This behavior is valuable in conjunction with `c:Ecto.Repo.transaction/2` because it
allows for rollbacks.
For example, an invalid changeset raises:
`* (Ecto.InvalidChangesetError) could not perform insert because changeset is invalid.`
> #### 🌟 Unique Jobs and Batching {: .warning}
>
> Only the [SmartEngine](https://getoban.pro/docs/pro/smart_engine.html) in [Oban
Expand Down

0 comments on commit 2f548b0

Please sign in to comment.