feat(clients/go): typed ErrUnauthenticated/ErrPermissionDenied on GatewayError (mxaccessgw#198)
This commit is contained in:
@@ -92,7 +92,11 @@ returned subscription owns cancellation and exposes `Close` for deterministic
|
||||
goroutine cleanup. Raw protobuf messages remain available through the
|
||||
`mxgateway` package aliases and the `Raw` helper methods. Typed errors support
|
||||
`errors.As` for `GatewayError`, `CommandError`, and `MxAccessError`; command
|
||||
errors preserve the raw reply.
|
||||
errors preserve the raw reply. Authentication failures are distinguishable with
|
||||
`errors.Is(err, mxgateway.ErrUnauthenticated)` (missing/rejected API key) and
|
||||
`errors.Is(err, mxgateway.ErrPermissionDenied)` (valid key, not authorised);
|
||||
both match a `*GatewayError` by its gRPC status code and leave the message
|
||||
(and its credential redaction) unchanged.
|
||||
|
||||
`EnsureMxAccessSuccess` follows COM semantics: only a **negative** HRESULT is a
|
||||
failure, so positive success codes such as `S_FALSE` (1) pass. `StatusSucceeded`
|
||||
|
||||
Reference in New Issue
Block a user