cuba-platform / documentation

CUBA Platform Documentation
https://www.cuba-platform.com
Creative Commons Attribution 4.0 International
25 stars 45 forks source link

Handling unique constraint violation exceptions in screens #741

Closed alexbudarov closed 3 years ago

alexbudarov commented 3 years ago

Description of the bug or enhancement

Forum topics: https://www.cuba-platform.com/discuss/t/violation-constraint-primary-key-message/12974 https://www.cuba-platform.com/discuss/t/unique-index-custom-exception-handler/963

Feedback from russian user learning CUBA re documentation:

Ability to set unique message for a thrown constraint error in the database - you can find it only in the list of all platform properties. Not obvious at all, and it's unlikely that someone would read through the list of all properties.

(he means https://doc.cuba-platform.com/manual-7.2/app_properties_reference.html#cuba.uniqueConstraintViolationPattern)

Suggestion: Create separate topic with title like "Handling unique constraint violation exceptions in screens". Mention mechanism of exception handlers, com.haulmont.cuba.gui.exception.UniqueConstraintViolationHandler, mentioned above application property. Move info about message localization from app properties section to new section.