Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle 404 error while adding a pet to an owner #130

Open
arey opened this issue Dec 31, 2023 · 0 comments
Open

Handle 404 error while adding a pet to an owner #130

arey opened this issue Dec 31, 2023 · 0 comments
Labels

Comments

@arey
Copy link
Member

arey commented Dec 31, 2023

The POST /owners/{ownerId}/pets does not return a 404 error when the ownerId does not exist but an error 400

{ 
   "className": "org.springframework.dao.DataIntegrityViolationException", 
   "exMessage": "could not execute statement [integrity constraint violation: foreign key no parent ; FK_PETS_OWNERS table: PETS value: 222] [insert into pets (birth_date,name,owner_id,type_id,id) values (?,?,?,?,default)]; SQL [insert into pets (birth_date,name,owner_id,type_id,id) values (?,?,?,?,default)]; constraint [FK_PETS_OWNERS]"
}

Same behaviour when a Pet does not exist

@arey arey added the bug label Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant