Business Logic: afterCreate event handler called even when error occured while saving

when I create a duplicate entity, and get a corresponding error

{
“code”: 1155,
“message”: “Duplicate entry”
}

afterCreate event handler is still called.

This behaviour is expected.

AfterCreate would be called in both cases. If request passes - created object would be available through “res.result”, and if request fails - error object would be available through “res.error” inside the handler.

Ok, thank you