Skip to content

Wrong error code for missing credentials: 40160 instead of 40106 (RSC1b) #2204

@paddybyers

Description

@paddybyers

Spec point

  • RSC1b: "If invalid arguments are provided such as no API key, no token and no means to create a token, then this will result in an error with error code 40106."

Observed behaviour

ably-js uses error code 40160 instead of the spec's 40106 when no credentials are provided.

Additionally, `{ useTokenAuth: true }` alone throws with no error code set at all.

Failing test

Test Expected Actual
`RSC1b - Error when no auth method available` Error code 40106 Error code 40160

Reproduction

```bash
RUN_DEVIATIONS=1 npx mocha --grep "RSC1b" test/uts/rest/auth/auth_scheme.test.ts
```

From PR #2191, branch `uts-rest`.

┆Issue is synchronized with this Jira Task by Unito

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working. It's clear that this does need to be fixed.uts-issueIssues raised there there is an apparent discrepancy between this library and the UTS tests

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions