Displaying custom error message in Admin UI in Strapi 4.8.x

i am using strapi 4.15 and below code works for me and even if we mention filed name in path key it also highlight field in admin ui form

const { errors } = require("@strapi/utils");
const { ApplicationError } = errors;      
throw new ApplicationError("Title already exist", {
        errors: [
          {
            path: ["title"],
            message: "This attribute must be unique",
            name: "ValidationError",
          },
        ],
      });
2 Likes