In version 1.4 there are better error messages for duplicate object, no creation permission and delete referenced object GN4-571
Duplicate object error
The standard error message returned by the system when the creation of an object fails because there is already an existing object with the same key has been improved. It now includes the descriptive name of referenced objects that are part of the key, instead than just the id - e.g.
Duplicate story with name 'story XX', folder '/system/users/Guest' (id: 7)
(new message) instead than
Duplicate story with name 'story XX', folder '7'
(old message).
Furthermore it is possible to customize these error messages, using translation strings with the new scope "ObjTypeDuplicateKeyError" that match the type of the object being created with the corresponding error message, e.g. adding the translation string :
<StringDesc Scope="ObjTypeDuplicateKeyError" Name="article" Value="There is already an article named '{2}' in the folder {1}" />
When the creation of an article fails because there is already an article with the same name in the same folder the error message will be:
There is already an article named 'my name' in the folder '/system/users/guest'
The system formats the complete message using the values of the object key attributes as the replacement parameters for "{0}", "{1}" etc. If a key is a reference attribute the system uses two replacement parameters: one with the id of the referenced object and one with its descriptive name.
In the case of a folder object the key is the folder (a reference) and the name, so parameter "{0}" is the folder id, "{1}" is the folder descriptive name - i.e. its path, and "{2}" is the object name.
If the custom error message is not correct - e.g. it contains an invalid parameter reference "{27}" - the system reverts to the standard error message.
No creation permission error
When the creation of a new object fails because the user does not have permissions, and the permissions come from a referenced object (e.g. a folder or a calendar), the system returns a new error message
User XXXX does not have permission to create YYYY in ZZZZ
where XXX is the user name, YYY is the type of the object and ZZZ is the description of the referenced object setting the permissions. For example when user 'editor' tries to create a story in the folder /system/users, the error message would be:
User editor does not have permission to create story in folder '/system/Users' (id: 7)
because the creation permissions for the story are set by the destination folder.
This is more informative of the previous error message that said only:
User XXXX does not have permission to create WWWW
where WWWW was the description of the object being created.
Delete referenced object error
It is now possible to customize the error message returned when an attempt to spike an object fails because it is referenced by other objects. Translation strings with the new scope "ObjFullAttrDeleteReferencedError" match the full name of the referencing attribute with the corresponding error message, e.g. adding the translation string:
<StringDesc Scope="ObjFullAttrDeleteReferencedError" Name="folderObject.folderRef" Value="It is not possible to delete {0} because it is not empty"/>
Attempts to delete the folder '/system/users/administrator' containing some objects (i.e objects with "folderObject.folderRef" referencing that folder) results in the error message:
It is not possible to delete folder '/system/users/Administrator' (id: 8) because it is not empty (ERR0230)
The system completes the message using the complete description of the object being deleted as "{0}" and the list of the referencing object as "{1}" (not used in the example above).
If the custom error message is not correct - e.g. it contains an invalid parameter reference "{3}" - the system reverts to the standard error message.