Stop The Creation of Data in BeforeCreate Lifecycle Callback Hook

Since throwing an error here causing 500 in response, so how to prevent creating the entry along with sending a custom error like 400 bad request?

Thanks.