Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle some cloud server error codes #955

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

EvanHahn
Copy link
Contributor

@EvanHahn EvanHahn commented Nov 6, 2024

This turns the server's TOO_MANY_PROJECTS error into the SERVER_HAS_TOO_MANY_PROJECTS error, and the PROJECT_NOT_IN_ALLOWLIST error into PROJECT_NOT_IN_SERVER_ALLOWLIST error.

See digidem/comapeo-cloud#33, which adds these codes.

This turns the server's `TOO_MANY_PROJECTS` error into the
`SERVER_HAS_TOO_MANY_PROJECTS` error, and the `PROJECT_NOT_IN_ALLOWLIST`
error into `PROJECT_NOT_IN_SERVER_ALLOWLIST` error.

See <digidem/comapeo-cloud#33>, which adds these
codes.
EvanHahn added a commit to digidem/comapeo-cloud that referenced this pull request Nov 6, 2024
This change:

- Normalizes response bodies to something like this:

  ```
  {
    "error": {
      "code": "SOMETHING_BAD",
      "message": "Something went wrong"
    }
  }
  ```

- Adds error codes for various errors

- Changes some 403s to 401s for correctness

See also: <digidem/comapeo-core#955>
@EvanHahn EvanHahn merged commit 6a3bb5b into main Nov 6, 2024
9 checks passed
@EvanHahn EvanHahn deleted the handle-server-error-codes branch November 6, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant