influxdb/testing
Jonathan A. Sternberg cbd04f2884
refactor: http error serialization matches the new error schema (#15196)
The http error schema has been changed to simplify the outward facing
API. The `op` and `error` attributes have been dropped because they
confused people. The `error` attribute will likely be readded in some
form in the future, but only as additional context and will not be
required or even suggested for the UI to use.

Errors are now output differently both when they are serialized to JSON
and when they are output as strings. The `op` is no longer used if it is
present. It will only appear as an optional attribute if at all. The
`message` attribute for an error is always output and it will be the
prefix for any nested error. When this is serialized to JSON, the
message is automatically flattened so a nested error such as:

    influxdb.Error{
        Msg: errors.New("something bad happened"),
        Err: io.EOF,
    }

This would be written to the message as:

    something bad happened: EOF

This matches a developers expectations much more easily as most
programmers assume that wrapping an error will act as a prefix for the
inner error.

This is flattened when written out to HTTP in order to make this logic
immaterial to a frontend developer.

The code is still present and plays an important role in categorizing
the error type. On the other hand, the code will not be output as part
of the message as it commonly plays a redundant and confusing role when
humans read it. The human readable message usually gives more context
and a message like with the code acting as a prefix is generally not
desired. But, the code plays a very important role in helping to
identify categories of errors and so it is very important as part of the
return response.
2019-09-19 10:06:47 -05:00
..
auth.go feat(http): find auths by org 2019-04-14 18:06:19 +08:00
bucket_service.go feat(kv): random ids without comma, space, backslash for org and bucket 2019-09-08 01:50:05 -05:00
checks.go fix(kv): fix the status check of check and notification 2019-09-03 10:21:39 -04:00
dashboards.go feat(http): add audit log 2019-05-16 10:57:28 -04:00
dbrp_mapping.go fix(inmem): fix dbrp not found 2019-07-03 15:54:57 -04:00
document.go feat(http): add audit log 2019-05-16 10:57:28 -04:00
id.go fix(influxdb): change resource to resource type 2019-01-15 12:57:57 -05:00
keyvalue_log.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
kv.go add spans to multiple services 2019-03-07 12:12:31 -07:00
label_service.go Fix typos in miscellaneous packages 2019-04-17 13:30:22 -07:00
notification_endpoint.go fix(pagerduty/rule): change url to clientURL for pagerduty endpoint/rule 2019-09-09 19:09:35 -04:00
notification_rule.go fix(notification/rule): filter for state changes in rules 2019-09-03 16:58:50 -04:00
onboarding.go feat(kv): add notification rule kv 2019-07-25 15:15:35 -04:00
organization_service.go feat(kv): random ids without comma, space, backslash for org and bucket 2019-09-08 01:50:05 -05:00
passwords.go refactor: http error serialization matches the new error schema (#15196) 2019-09-19 10:06:47 -05:00
scraper_target.go feat(influxdb): add scraper filter 2019-04-25 11:33:34 -04:00
secret.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
session.go Fix typos in miscellaneous packages 2019-04-17 13:30:22 -07:00
source.go chore: rename imports from platform to influxdb 2019-01-09 20:51:47 -08:00
telegraf.go refactor: http error serialization matches the new error schema (#15196) 2019-09-19 10:06:47 -05:00
user_resource_mapping_service.go refactor: http error serialization matches the new error schema (#15196) 2019-09-19 10:06:47 -05:00
user_service.go feat(kv): implemented key/value store with end-to-end integration tests 2019-02-19 17:47:19 -06:00
util.go feat(kv): add check kv 2019-07-31 18:52:13 -04:00
variable.go gofmt 2019-06-20 16:25:38 -07:00