Stop The Creation of Data in BeforeCreate Lifecycle Callback Hook

module.exports = {
  lifecycles: {
    beforeCreate(data) {
    	if (isNaughtyLink(data.link)) {
    		//throw error here, it will prevent the entry creation
    		throw new Error('You Shall Not Pass!!!');
    	}
    },
  },
};

It is not recommended to throw errors inside lifecycle, as it will throw also the error inside console.
If you have Sentry configured than it will also log the error into sentry.

2 Likes