-
Notifications
You must be signed in to change notification settings - Fork 3
Description
When importing or exporting nodesets, error messages are sometimes vague or even misleading. Ideally, error messages would pinpoint the specific problem that has been observed and suggest one or more corrective actions.
Example of a poor error message
The import failed.
Nodeset validation failed: One or more errors occurred.
(Response status code does not indicate success: 404 (Not Found).).
The number of errors that have occurred is unclear: it might have been one. It might have been more than one. The reference to the status code 404 might suggest that the problem involves an internal system error that has nothing to do with the specific data the user has provided.
Example of a good error message
The import failed.
An error occurred during the import: An item with the same key has already been added. Key: ns=1;i=6.
Importing Nodeset: MyNewNodeset.Nodeset2.xml
This is a pretty good error message. Although not stated, the corrective action is straightforward: find the duplicates. If the nodes are exactly identical, delete one of them. If not identical, change the value for one of the nodes.
Improving on a good error message.
Fixing one duplicate key entry is easy enough. But what happens when there are dozens of duplicate key entries. In such a case, a user might prefer to see a list of all duplicate keys (along with any other errors).
It is clear that a single error is enough to halt import processing. In some cases, this might be the only feasible approach. But if possible, users might get more value if all of the nodes in a file could be scanned and feedback given for the ones with real (or even potential) problems.