Project

General

Profile

Actions

Bug #34627

open

Inconsistent error messages

Added by Oleh Fedorenko about 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
User experience
Target version:
-
Difficulty:
Triaged:
No
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Majority of the hammer commands have standard failure messages which will be shown if an error occurred, providing more information of what happened based on the server's response.

The problem is we rely on response to have message or full_messages key, which in this case is not present. If there is an error 422 the response should contain {"errors"=>{"template_kind_id"=>["can't be blank"]}} and we could add a parser method for this as well, but some responses can contain: {"error"=>{"id"=>nil, "errors"=>{"name"=>["has already been taken"]}, "full_messages"=>["DNS domain has already been taken"]}}. It seems like the problem should be solved on both sides:

1. Ensure consistent error messages on the server side.
2. Parse those messages and show the users all related information about the error.

Command to test with:

hammer domain create --name example.com (x2). Observe the error.
hammer template import (use improper templates). Observer the error.

In both cases the error should tell what's exactly went wrong.

No data to display

Actions

Also available in: Atom PDF