Cysource/TonicDNS — Issue #5: Detailed error messages
Author: LordGaav
Created: 2012-01-05 10:34:46+00:00
State: open

In the current design, when an error occurs, the client is presented with a message that contains an "error" -> "message" mapping, with a human readable error message detailing what is wrong.

A proposed change is that we also include a machine readable version, maybe something like:

```
error:
"Human Readable message"
details:
[
{
code: AUTH_USERNAME_INVALID
},
{
code: RECORD_BOTH_AAAA_TRAILINGDOT
id: 5
},
{
code: RECORD_LHS_CNAME_INVALID
id: 6
}
]
```

"error" still contains the normal human readable version that we use now. "details" will be an array of object (if using JSON) with an error code per error that occurred. In case of validation of record, we can also include an index of the record that failed validation, but this field is optional in most other cases because it is not relevant there (say, an invalid token during authentication).