[ https://issues.apache.org/jira/browse/SYNCOPE-866?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15313815#comment-15313815 ]
ASF GitHub Bot commented on SYNCOPE-866: ---------------------------------------- GitHub user tmess567 opened a pull request: https://github.com/apache/syncope/pull/18 Added Exception for existing key (SYNCOPE-866) I have added a new Exception named **KeyAlreadyExistsException** and attached it to the **MailTemplateLogic** and **ReportTemplateLogic** classes to check for duplicate keys and throw the new Exception. I have also tested this out on Swagger and attached screenshots of the error for both **MailTemplates**  and **ReportTemplates**.  You can merge this pull request into a Git repository by running: $ git pull https://github.com/tmess567/syncope SYNCOPE-866 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/syncope/pull/18.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #18 ---- commit 42ecce4b5b35f7b540c77b65faf39f6b1bd9b7db Author: Tushar <tusharm...@gmail.com> Date: 2016-06-03T07:54:02Z Added Exception for existing key (SYNCOPE-866) ---- > Check for existence of key before adding template > ------------------------------------------------- > > Key: SYNCOPE-866 > URL: https://issues.apache.org/jira/browse/SYNCOPE-866 > Project: Syncope > Issue Type: Improvement > Components: core > Reporter: Tushar Mishra > Fix For: 2.0.0 > > > The create(String key) method in the MailTemplateLogic and > ReportTemplateLogic classes of the org.apache.syncope.core.logic package > should check if the key being added to the MailTemplateDAO instance is > already present. If such a key already exists, it should throw an appropriate > exception for the same. -- This message was sent by Atlassian JIRA (v6.3.4#6332)