Commit Graph

10 Commits (e79be29224c58b2cd929a871c86971682399dfe5)

Author SHA1 Message Date
Michael Desa b590259a97 fix(platform): check for (*platform.Error)(nil) in error functions
As of https://github.com/influxdata/platform/pull/2192 a panic was
introduced in the startup of platform. It is the result of
`Error{Code,Op,Message}` being passed a `(*platform.Error)(nil)`
instead of an `(error)(nil)`.

Specifically
```
   if err == nil {
        return ""
    } else if e, ok := err.(*Error); ok && e.Code != "" {
        return e.Code
    }
```
will panic when err is `(*platform.Error)(nil)` as the `err == nil`
check will fail and the `e, ok := err.(*Error); ok && e.Code != ""` will
succeed and panic on `e.Code`, as `e` is nil.

This panic could have been avoided if all methods returned `error`
instead of `*platform.Error`.
2019-01-04 11:02:26 -05:00
zhulongcheng f3bf670706 rename msg to message for platform.Error json 2018-12-27 10:34:00 +08:00
zhulongcheng e73d4fc637 add MethodNotAllowed handler 2018-12-23 15:55:45 +08:00
Michael Desa 9d1ed7a8d6 fix(platform): rename "msg" field to "message" for Error json 2018-12-19 13:13:15 -05:00
Kelvin Wang d939732141 fix(platform): use json struct instead of string for embed error 2018-12-17 11:18:04 -05:00
Kelvin Wang 25eebd0084 fix(http): convert auth errors 2018-11-16 19:33:20 -05:00
Kelvin Wang 8d15d70360 fix(http): convert auth errors 2018-11-16 19:30:34 -05:00
Chris Goller 6054288f3e feat(kit/grpc): add translation between gRPC status and platform.Error 2018-11-15 21:16:48 -06:00
Kelvin Wang 3552af6386 feat: add onboarding defaults 2018-09-27 15:02:17 -04:00
Kelvin Wang 4cd8a48c39 feat(errors): add errors lib 2018-09-07 21:45:47 -05:00