Project

General

Profile

Actions

User story #5346

closed

Output user friendy error message in th API (parameter id already used)

Added by Nicolas PERRON over 10 years ago. Updated 7 months ago.

Status:
Resolved
Priority:
2
Assignee:
-
Category:
API
UX impact:
Suggestion strength:
User visibility:
Effort required:
Name check:
Fix check:
Regression:
No

Description

When creating a Parameter with API, if the id is already used, the error message is not user-friendly:

root@server:~# curl -k -H "X-API-Token: PojCJDhajkGqVx1TTmiZKNFZORKOYc8X" -H "Content-Type: application/json" -X PUT https://localhost/rudder/api/2/parameters?prettify=true -d @/tmp/new-rudder-parameter.json 
{
  "action": "createParameter",
  "id": "rudder_file_edit_footer",
  "result": "error",
  "errorDetails": "Create failed, cause is: Error processing Failure(Error processing GlobalParameterChanges(GlobalParameterChange(None,GlobalParameterChangeItem(EventActor(REST Account: \"API_USER1\" (B3C197D9-7FAF-48C5-9840-CF75610857B9)),2014-08-01T10:05:11.241Z,None,AddGlobalParameterDiff(GlobalParameter(ParameterName(rudder_file_edit_footer),### End of file managed by Rudder ###,Default inform message put in footer of managed files by Rudder,false))),List()),List()),Empty,Full(Failure(Cannot create a global parameter with name rudder_file_edit_footer : there is already a parameter with the same name,Empty,Empty)))." 

It seems that the error are not well catched by Rudder at this level.

Actions

Also available in: Atom PDF