Skip to content

Conversation

@sylver
Copy link
Contributor

@sylver sylver commented Jun 14, 2018

When the rejectOnEmpty flag is set in a model, an EmptyResultError is raised during a findAll
promise in add* and set* accessors of the BelongsToMany association. This fix prevents it by
catching only this error and throwing any unexpected others.

fix #9531

When the `rejectOnEmpty` flag is set in a model, an `EmptyResultError` is raised during a `findAll`
promise in add* and set* accessors of the BelongsToMany association. This fix prevents it by
catching only this error and throwing any unexpected others.

fix #9531
@codecov
Copy link

codecov bot commented Jun 14, 2018

Codecov Report

Merging #9535 into master will increase coverage by <.01%.
The diff coverage is 100%.

@sushantdhiman sushantdhiman requested a review from a team June 15, 2018 04:29
@sushantdhiman sushantdhiman merged commit 15ce72b into sequelize:master Jun 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add* and set* methods from belongsToMany raise SequelizeEmptyResultError if rejectOnEmpty is set to true in the target model

3 participants