liquid_feedback_frontend
changeset 1811:c8fe2498a1af
Added better error handling
author | bsw |
---|---|
date | Thu Dec 02 13:30:20 2021 +0100 (2021-12-02) |
parents | 0a243b9aac6b |
children | fc3f15316a68 |
files | app/main/registration_admin/_action/update_verification.lua |
line diff
1.1 --- a/app/main/registration_admin/_action/update_verification.lua Thu Dec 02 13:22:15 2021 +0100 1.2 +++ b/app/main/registration_admin/_action/update_verification.lua Thu Dec 02 13:30:20 2021 +0100 1.3 @@ -66,7 +66,18 @@ 1.4 member.identification = identification 1.5 1.6 member.notify_email = param.get("email") 1.7 - member:save() 1.8 + db_error = member:try_save() 1.9 + 1.10 + if db_error then 1.11 + if db_error.is_kind_of("IntegrityConstraintViolation.UniqueViolation") then 1.12 + slot.select("error", function() 1.13 + ui.tag{ content = _"Identification unique violation: This identification is already in use for another member." } 1.14 + end ) 1.15 + return false 1.16 + else 1.17 + error(db_error) 1.18 + end 1.19 + end 1.20 1.21 update_data() 1.22