Throw Error message in lifecycle hook doesnt change the error message display in the UI

Here is my lifecycles.js (this is just a PoC) that works (Strapi v4.1.5).
A warning is shown with my message.

What I would really like to do is to show the error message at the specific field - but that seems a bit far fetched :slight_smile:

const { ApplicationError } = require("@strapi/utils").errors

module.exports = {
	beforeUpdate(event) {
		const { data } = event.params
		console.log("product-beforeUpdate", data)
		if (data.price === null || data.price === 0 || data.price === "") {
			throw new ApplicationError("Product Price needs to be set!")
		}
	}
}
3 Likes