influxdb/inmem
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_service.go feat(http): find auths by org 2019-04-14 18:06:19 +08:00
auth_test.go Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
bucket_service.go feat(http): Add bucket types (#15045) 2019-09-06 17:52:54 -07:00
bucket_test.go feat(kv): random ids without comma, space, backslash for org and bucket 2019-09-08 01:50:05 -05:00
dashboard.go fix(kv): updatedAt should be updated as well 2019-05-18 23:36:48 -04:00
dashboard_test.go feat(http): add audit log 2019-05-16 10:57:28 -04:00
dbrp_mapping_service.go fix(inmem): fix dbrp not found 2019-07-03 15:54:57 -04:00
dbrp_mapping_test.go Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
kv.go Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
kv_test.go add spans to multiple services 2019-03-07 12:12:31 -07:00
label_service.go feat(http): accept label id for template post 2019-04-11 13:16:39 -04:00
lookup_service.go Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
lookup_service_test.go fix(influxdb): rename telegraf orgID 2019-06-03 16:20:53 -04:00
onboarding.go remove org from bucket 2019-04-22 18:39:05 -04:00
onboarding_test.go feat(influxdb): bucket created and updated time 2019-05-17 11:49:10 -04:00
organization_service.go feat(influxdb): add org create and update time 2019-05-20 17:36:29 -07:00
organization_test.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
passwords_test.go Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
scraper.go feat(influxdb): add scraper filter 2019-04-25 11:33:34 -04:00
scraper_test.go feat(influxdb): add scraper filter 2019-04-25 11:33:34 -04:00
service.go feat(http): add audit log 2019-05-16 10:57:28 -04:00
session.go Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
source.go Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
telegraf.go fix(influxdb): rename telegraf orgID 2019-06-03 16:20:53 -04:00
telegraf_test.go Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
user_resource_mapping_service.go Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
user_resource_mapping_test.go Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
user_service.go Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
user_test.go Revert "fix(inmem): remove the old inmem implementation" 2019-04-09 14:24:40 -04:00
variable.go fix tests 2019-06-20 16:25:38 -07:00
variable_test.go feat(http): adding createdAt variable 2019-06-20 16:25:38 -07:00