When raising an error message within a user event script, employ the following method to exclusively display the custom error message without revealing additional error details:
// Throw a user-friendly error
const customError = error.create({
name: 'INVALID_FIELD_VALUE',
//cause: messages,
message: messages
});
throw customError.message;